forked from pool/slurm
Egbert Eich
55d6d2b0c7
- Fix security issue in handling of username and gid fields CVE-2018-10995 what implied an update from 17.11.5 to 17.11.7 - Update from 17.11.5 to 17.11.7 Highlights of 17.11.6: * CRAY - Add slurmsmwd to the contribs/cray dir * PMIX - Added the direct connect authentication. * Prevent the backup slurmctld from losing the active/available node features list on takeover. * Be able to force power_down of cloud node even if in power_save state. * Allow cloud nodes to be recognized in Slurm when booted out of band. * Numerous fixes - check 'NEWS' file. Highlights of 17.11.7: * Notify srun and ctld when unkillable stepd exits. * Numerous fixes - check 'NEWS' file. OBS-URL: https://build.opensuse.org/request/show/615950 OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=58
73 lines
2.0 KiB
Diff
73 lines
2.0 KiB
Diff
From 9533827148d1214b8fe9a9ba47a9dd20287085d7 Mon Sep 17 00:00:00 2001
|
|
From: Christian Goll <cgoll@suse.de>
|
|
Date: Mon, 9 Apr 2018 11:13:54 +0200
|
|
Subject: [PATCH 4/6] slurmdbd uses xdaemon_* for systemd
|
|
|
|
---
|
|
src/slurmdbd/slurmdbd.c | 18 +++++++++++++-----
|
|
1 file changed, 13 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/src/slurmdbd/slurmdbd.c b/src/slurmdbd/slurmdbd.c
|
|
index ae2f27d617..7b336b824f 100644
|
|
--- a/src/slurmdbd/slurmdbd.c
|
|
+++ b/src/slurmdbd/slurmdbd.c
|
|
@@ -103,7 +103,7 @@ static List lft_rgt_list = NULL;
|
|
static void _become_slurm_user(void);
|
|
static void _commit_handler_cancel(void);
|
|
static void *_commit_handler(void *no_data);
|
|
-static void _daemonize(void);
|
|
+static int _daemonize_start(void);
|
|
static void _default_sigaction(int sig);
|
|
static void _free_dbd_stats(void);
|
|
static void _init_config(void);
|
|
@@ -127,6 +127,7 @@ int main(int argc, char **argv)
|
|
{
|
|
char node_name_short[128];
|
|
char node_name_long[128];
|
|
+ int pipefd;
|
|
void *db_conn = NULL;
|
|
assoc_init_args_t assoc_init_arg;
|
|
|
|
@@ -150,8 +151,9 @@ int main(int argc, char **argv)
|
|
slurmdbd_defs_init(slurmdbd_conf->auth_info);
|
|
|
|
_kill_old_slurmdbd();
|
|
- if (foreground == 0)
|
|
- _daemonize();
|
|
+ if (foreground == 0) {
|
|
+ pipefd = _daemonize_start();
|
|
+ }
|
|
|
|
/*
|
|
* Need to create pidfile here in case we setuid() below
|
|
@@ -160,6 +162,9 @@ int main(int argc, char **argv)
|
|
* able to write a core dump.
|
|
*/
|
|
_init_pidfile();
|
|
+ if (foreground == 0) {
|
|
+ xdaemon_finish(pipefd);
|
|
+ }
|
|
_become_slurm_user();
|
|
if (foreground == 0)
|
|
_set_work_dir();
|
|
@@ -595,11 +600,14 @@ static void _init_pidfile(void)
|
|
|
|
/* Become a daemon (child of init) and
|
|
* "cd" to the LogFile directory (if one is configured) */
|
|
-static void _daemonize(void)
|
|
+static int _daemonize_start(void)
|
|
{
|
|
- if (xdaemon())
|
|
+ int retval;
|
|
+ retval = xdaemon_init();
|
|
+ if (retval == -1)
|
|
error("daemon(): %m");
|
|
log_alter(log_opts, LOG_DAEMON, slurmdbd_conf->log_file);
|
|
+ return retval;
|
|
}
|
|
|
|
static void _set_work_dir(void)
|
|
--
|
|
2.13.7
|
|
|