2018-06-11 12:31:14 +02:00
|
|
|
From f0650e14983c9551fd644697285d84b35dad16aa Mon Sep 17 00:00:00 2001
|
2018-04-12 18:42:36 +02:00
|
|
|
From: Christian Goll <cgoll@suse.de>
|
2018-06-11 12:31:14 +02:00
|
|
|
Date: Mon, 9 Apr 2018 10:23:01 +0200
|
|
|
|
Subject: [PATCH 2/6] slurmctld uses xdaemon_* for systemd
|
2018-04-12 18:42:36 +02:00
|
|
|
|
|
|
|
---
|
2018-06-11 12:31:14 +02:00
|
|
|
src/slurmctld/controller.c | 11 +++++++++--
|
|
|
|
1 file changed, 9 insertions(+), 2 deletions(-)
|
2018-04-12 18:42:36 +02:00
|
|
|
|
|
|
|
diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c
|
2018-06-11 12:31:14 +02:00
|
|
|
index 7867e1d479..bd1c12600e 100644
|
2018-04-12 18:42:36 +02:00
|
|
|
--- a/src/slurmctld/controller.c
|
|
|
|
+++ b/src/slurmctld/controller.c
|
|
|
|
@@ -250,7 +250,7 @@ static bool _wait_for_server_thread(void);
|
|
|
|
/* 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;
|
|
|
|
struct stat stat_buf;
|
|
|
|
struct rlimit rlim;
|
|
|
|
/* Locks: Write configuration, job, node, and partition */
|
2018-06-11 12:31:14 +02:00
|
|
|
@@ -298,7 +298,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
|
|
|
+ /*
|
|
|
|
+ * Just start daemonizing if not in test mode
|
|
|
|
+ */
|
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-06-11 12:31:14 +02:00
|
|
|
@@ -318,6 +322,9 @@ int main(int argc, char **argv)
|
2018-04-12 18:42:36 +02:00
|
|
|
*/
|
|
|
|
_init_pidfile();
|
|
|
|
_become_slurm_user();
|
|
|
|
+ if (daemonize) {
|
|
|
|
+ xdaemon_finish(fd);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create StateSaveLocation directory if necessary.
|
2018-06-11 12:31:14 +02:00
|
|
|
--
|
|
|
|
2.13.7
|
|
|
|
|