Hello!

    When backup controller is switching in controller mode it deletes own
PID file what isn't desirable in most cases. Bug is found, see fix in the
attached patch.

    With best regards.
    Andriy.
diff -udpr slurm-2.3.0/src/slurmctld/backup.c slurm-2.3.0.backup/src/slurmctld/backup.c
--- slurm-2.3.0/src/slurmctld/backup.c	2011-09-13 01:44:28.000000000 +0300
+++ slurm-2.3.0.backup/src/slurmctld/backup.c	2011-09-15 17:01:13.000000000 +0300
@@ -179,15 +179,15 @@ void run_backup(void)
 		}
 	}
 
-	/* Since pidfile is created as user root (its owner is
-	 *   changed to SlurmUser) SlurmUser may not be able to
-	 *   remove it, so this is not necessarily an error.
-	 * No longer need slurmctld_conf lock after above join. */
-	if (unlink(slurmctld_conf.slurmctld_pidfile) < 0)
-		verbose("Unable to remove pidfile '%s': %m",
-			slurmctld_conf.slurmctld_pidfile);
-
 	if (slurmctld_config.shutdown_time != 0) {
+		/* Since pidfile is created as user root (its owner is
+		 *   changed to SlurmUser) SlurmUser may not be able to
+		 *   remove it, so this is not necessarily an error.
+		 * No longer need slurmctld_conf lock after above join. */
+		if (unlink(slurmctld_conf.slurmctld_pidfile) < 0)
+			verbose("Unable to remove pidfile '%s': %m",
+				slurmctld_conf.slurmctld_pidfile);
+
 		info("BackupController terminating");
 		pthread_join(slurmctld_config.thread_id_sig, NULL);
 		log_fini();

Reply via email to