2018-11-20 18:07:44 +01:00
|
|
|
From: Egbert Eich <eich@suse.com>
|
|
|
|
Date: Tue Nov 20 09:47:47 2018 +0100
|
|
|
|
Subject: slurmctld uses xdaemon_* for systemd
|
|
|
|
Patch-mainline: Not yet
|
|
|
|
Git-commit: 0f0c00a4a57d12be04d16f4646c186d3e5f03dd1
|
|
|
|
References: bsc#1084125
|
2018-04-12 18:42:36 +02:00
|
|
|
|
2018-11-20 18:07:44 +01:00
|
|
|
Signed-off-by: Egbert Eich <eich@suse.com>
|
2018-04-12 18:42:36 +02:00
|
|
|
---
|
2018-11-20 18:07:44 +01:00
|
|
|
slurm-18.08.3/src/slurmctld/controller.c | 11 +++++++++--
|
2018-06-11 12:31:14 +02:00
|
|
|
1 file changed, 9 insertions(+), 2 deletions(-)
|
2018-11-20 18:07:44 +01:00
|
|
|
diff --git a/slurm-18.08.3/src/slurmctld/controller.c b/slurm-18.08.3/src/slurmctld/controller.c
|
|
|
|
index a1762de..d123db3 100644
|
2018-04-12 18:42:36 +02:00
|
|
|
--- a/src/slurmctld/controller.c
|
|
|
|
+++ b/src/slurmctld/controller.c
|
2018-11-20 18:07:44 +01:00
|
|
|
@@ -260,7 +260,7 @@ static void * _wait_primary_prog(void *arg);
|
2018-04-12 18:42:36 +02:00
|
|
|
/* main - slurmctld main function, start various threads and process RPCs */
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
- int cnt, error_code, i;
|
|
|
|
+ int cnt, error_code, i, fd;
|
2018-11-20 18:07:44 +01:00
|
|
|
struct timeval start, now;
|
2018-04-12 18:42:36 +02:00
|
|
|
struct stat stat_buf;
|
|
|
|
struct rlimit rlim;
|
2018-11-20 18:07:44 +01:00
|
|
|
@@ -326,7 +326,11 @@ int main(int argc, char **argv)
|
2018-04-12 18:42:36 +02:00
|
|
|
|
|
|
|
if (daemonize) {
|
|
|
|
slurmctld_config.daemonize = 1;
|
|
|
|
- if (xdaemon())
|
2018-06-11 12:31:14 +02:00
|
|
|
+ /*
|
2018-11-20 18:07:44 +01:00
|
|
|
+ * Just start daemonizing if not in test mode
|
2018-06-11 12:31:14 +02:00
|
|
|
+ */
|
2018-04-12 18:42:36 +02:00
|
|
|
+ fd = xdaemon_init();
|
|
|
|
+ if (fd == -1)
|
|
|
|
error("daemon(): %m");
|
|
|
|
log_set_timefmt(slurmctld_conf.log_fmt);
|
|
|
|
log_alter(log_opts, LOG_DAEMON,
|
2018-11-20 18:07:44 +01:00
|
|
|
@@ -348,6 +352,9 @@ int main(int argc, char **argv)
|
|
|
|
_init_pidfile();
|
|
|
|
_become_slurm_user();
|
|
|
|
}
|
2018-04-12 18:42:36 +02:00
|
|
|
+ if (daemonize) {
|
|
|
|
+ xdaemon_finish(fd);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create StateSaveLocation directory if necessary.
|