diff options
Diffstat (limited to 'sys-cluster/slurm/files/slurmctld.initd')
-rw-r--r-- | sys-cluster/slurm/files/slurmctld.initd | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sys-cluster/slurm/files/slurmctld.initd b/sys-cluster/slurm/files/slurmctld.initd new file mode 100644 index 000000000000..0ebba3ea8616 --- /dev/null +++ b/sys-cluster/slurm/files/slurmctld.initd @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/slurm/files/slurmctld.initd,v 1.1 2011/07/03 23:23:21 alexxy Exp $ + +opts="reload" + +[[ -f /etc/conf.d/slurm ]] && . /etc/conf.d/slurm + +depend() { + local _need="net" + [[ ${SLURM_USE_MUNGE} -ne 0 ]] && _need="${_need} munged" + after logger + need ${_need} +} + +checkconfig() { + if [ ! -e "/etc/slurm/slurm.conf" ]; then + eerror "Missing config /etc/slurm/slurm.conf" + eerror "Customize sample one or generate new by configurator.html" + eerror "in slurm doc directory" + return 1 + fi +} + +start() { + ebegin "Starting slurm control daemon" + start-stop-daemon --start --quiet --background \ + --pidfile /var/run/slurm/slurmctld.pid \ + --user slurm \ + --group slurm \ + --exec /usr/sbin/slurmctld -- ${SLURMCTLD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping slurm control daemon" + start-stop-daemon --stop --pidfile /var/run/slurm/slurmctld.pid + eend $? +} + +reload() { + ebegin "Reloading slurm daemon configuration" + killproc slurmctld -HUP + eend $? +} |