diff options
author | Justin Lecher <jlec@gentoo.org> | 2018-11-10 13:25:08 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2018-11-10 13:25:37 +0000 |
commit | 9aa4f6dd9345daba4b121c66b31548c67bcac400 (patch) | |
tree | 31508b6c902d1c8aed1fd11698f6a233290f8d27 | |
parent | sys-auth/munge: Update init (diff) | |
download | gentoo-9aa4f6dd9345daba4b121c66b31548c67bcac400.tar.gz gentoo-9aa4f6dd9345daba4b121c66b31548c67bcac400.tar.bz2 gentoo-9aa4f6dd9345daba4b121c66b31548c67bcac400.zip |
sys-cluster/slurm: Fix init stuff
Signed-off-by: Justin Lecher <jlec@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
-rw-r--r-- | sys-cluster/slurm/files/slurmctld.initd | 26 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmd.initd | 22 | ||||
-rw-r--r-- | sys-cluster/slurm/files/slurmdbd.initd | 22 | ||||
-rw-r--r-- | sys-cluster/slurm/slurm-18.08.3-r1.ebuild (renamed from sys-cluster/slurm/slurm-18.08.3.ebuild) | 27 |
4 files changed, 59 insertions, 38 deletions
diff --git a/sys-cluster/slurm/files/slurmctld.initd b/sys-cluster/slurm/files/slurmctld.initd index e87dfdb83ad3..5cb5888fa153 100644 --- a/sys-cluster/slurm/files/slurmctld.initd +++ b/sys-cluster/slurm/files/slurmctld.initd @@ -1,5 +1,5 @@ #!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2018 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 extra_commands="reload" @@ -25,7 +25,7 @@ create_folder_and_set_permission() { eerror "SLURM: folder == ${folder} == /var/tmp" exit fi - checkpath -d -o slurm:slurm ${folder} + checkpath -d -o slurm:slurm "${folder}" } checkconfig() { @@ -35,12 +35,20 @@ checkconfig() { eerror "in slurm doc directory" return 1 fi - + # Make sure folders exists . /etc/slurm/slurm.conf - folders=(${SlurmdSpoolDir} `dirname ${SlurmctldLogFile}` `dirname ${SlurmctldPidFile}` `dirname ${SlurmdLogFile}` `dirname ${SlurmdPidFile}` ${SlurmdSpoolDir} ${StateSaveLocation}) - for folder in ${folders[*]}; do - create_folder_and_set_permission ${folder} + folders=( + ${SlurmdSpoolDir} + $(dirname ${SlurmctldLogFile}) + $(dirname ${SlurmctldPidFile}) + $(dirname ${SlurmdLogFile}) + $(dirname ${SlurmdPidFile}) + ${SlurmdSpoolDir} + ${StateSaveLocation} + ) + for folder in ${folders[@]}; do + create_folder_and_set_permission "${folder}" done } @@ -48,7 +56,7 @@ start() { ebegin "Starting slurm control daemon" checkconfig start-stop-daemon --start --quiet --background \ - --pidfile /var/run/slurm/slurmctld.pid \ + --pidfile /run/slurm/slurmctld.pid \ --user slurm \ --group slurm \ --exec /usr/sbin/slurmctld -- ${SLURMCTLD_OPTS} @@ -57,12 +65,12 @@ start() { stop() { ebegin "Stopping slurm control daemon" - start-stop-daemon --stop --pidfile /var/run/slurm/slurmctld.pid + start-stop-daemon --stop --pidfile /run/slurm/slurmctld.pid eend $? } reload() { ebegin "Reloading slurm daemon configuration" - start-stop-daemon --signal HUP --pidfile /var/run/slurm/slurmctld.pid + start-stop-daemon --signal HUP --pidfile /run/slurm/slurmctld.pid eend $? } diff --git a/sys-cluster/slurm/files/slurmd.initd b/sys-cluster/slurm/files/slurmd.initd index a4a165be87d3..dd9797c0c7d2 100644 --- a/sys-cluster/slurm/files/slurmd.initd +++ b/sys-cluster/slurm/files/slurmd.initd @@ -1,5 +1,5 @@ #!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2018 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 extra_commands="reload" @@ -37,9 +37,17 @@ checkconfig() { fi # Make sure folders exists . /etc/slurm/slurm.conf - folders=(${SlurmdSpoolDir} `dirname ${SlurmctldLogFile}` `dirname ${SlurmctldPidFile}` `dirname ${SlurmdLogFile}` `dirname ${SlurmdPidFile}` ${SlurmdSpoolDir} ${StateSaveLocation}) - for folder in ${folders[*]}; do - create_folder_and_set_permission ${folder} + folders=( + ${SlurmdSpoolDir} + $(dirname ${SlurmctldLogFile}) + $(dirname ${SlurmctldPidFile}) + $(dirname ${SlurmdLogFile}) + $(dirname ${SlurmdPidFile}) + ${SlurmdSpoolDir} + ${StateSaveLocation} + ) + for folder in ${folders[@]}; do + create_folder_and_set_permission "${folder}" done } @@ -51,7 +59,7 @@ start() { # and https://computing.llnl.gov/linux/slurm/faq.html#rlimit ulimit -l unlimited start-stop-daemon --start --quiet --background \ - --pidfile /var/run/slurm/slurmd.pid \ + --pidfile /run/slurm/slurmd.pid \ --user root \ --group root \ --exec /usr/sbin/slurmd -- ${SLURMD_OPTS} @@ -60,12 +68,12 @@ start() { stop() { ebegin "Stopping slurm daemon" - start-stop-daemon --stop --pidfile /var/run/slurm/slurmd.pid + start-stop-daemon --stop --pidfile /run/slurm/slurmd.pid eend $? } reload() { ebegin "Reloading slurm daemon configuration" - start-stop-daemon --signal HUP --pidfile /var/run/slurm/slurmd.pid + start-stop-daemon --signal HUP --pidfile /run/slurm/slurmd.pid eend $? } diff --git a/sys-cluster/slurm/files/slurmdbd.initd b/sys-cluster/slurm/files/slurmdbd.initd index 296afaf9421c..27b5102101cb 100644 --- a/sys-cluster/slurm/files/slurmdbd.initd +++ b/sys-cluster/slurm/files/slurmdbd.initd @@ -1,5 +1,5 @@ #!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2018 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 extra_commands="reload" @@ -36,9 +36,17 @@ checkconfig() { # Make sure folders exists . /etc/slurm/slurm.conf - folders=(${SlurmdSpoolDir} `dirname ${SlurmctldLogFile}` `dirname ${SlurmctldPidFile}` `dirname ${SlurmdLogFile}` `dirname ${SlurmdPidFile}` ${SlurmdSpoolDir} ${StateSaveLocation}) - for folder in ${folders[*]}; do - create_folder_and_set_permission ${folder} + folders=( + ${SlurmdSpoolDir} + $(dirname ${SlurmctldLogFile}) + $(dirname ${SlurmctldPidFile}) + $(dirname ${SlurmdLogFile}) + $(dirname ${SlurmdPidFile}) + ${SlurmdSpoolDir} + ${StateSaveLocation} + ) + for folder in ${folders[@]}; do + create_folder_and_set_permission "${folder}" done } @@ -46,7 +54,7 @@ start() { ebegin "Starting slurmdb daemon" checkconfig start-stop-daemon --start --quiet --background \ - --pidfile /var/run/slurm/slurmdbd.pid \ + --pidfile /run/slurm/slurmdbd.pid \ --user slurm \ --group slurm \ --exec /usr/sbin/slurmdbd -- ${SLURMD_OPTS} @@ -55,12 +63,12 @@ start() { stop() { ebegin "Stopping slurmdb daemon" - start-stop-daemon --stop --pidfile /var/run/slurm/slurmdbd.pid + start-stop-daemon --stop --pidfile /run/slurm/slurmdbd.pid eend $? } reload() { ebegin "Reloading slurmdb daemon configuration" - start-stop-daemon --signal HUP --pidfile /var/run/slurm/slurmdbd.pid + start-stop-daemon --signal HUP --pidfile /run/slurm/slurmdbd.pid eend $? } diff --git a/sys-cluster/slurm/slurm-18.08.3.ebuild b/sys-cluster/slurm/slurm-18.08.3-r1.ebuild index d217effa43ac..92e034a9760e 100644 --- a/sys-cluster/slurm/slurm-18.08.3.ebuild +++ b/sys-cluster/slurm/slurm-18.08.3-r1.ebuild @@ -88,27 +88,24 @@ src_prepare() { default # pids should go to /var/run/slurm - sed -e "s:/var/run/slurmctld.pid:${EPREFIX}/run/slurm/slurmctld.pid:g" \ + sed \ + -e 's:/tmp:/var/tmp:g' \ + -e "s:/var/run/slurmctld.pid:${EPREFIX}/run/slurm/slurmctld.pid:g" \ -e "s:/var/run/slurmd.pid:${EPREFIX}/run/slurm/slurmd.pid:g" \ + -e "s:StateSaveLocation=.*:StateSaveLocation=${EPREFIX}/var/spool/slurm:g" \ + -e "s:SlurmdSpoolDir=.*:SlurmdSpoolDir=${EPREFIX}/var/spool/slurm/slurmd:g" \ -i "${S}/etc/slurm.conf.example" \ - || die "Can't sed for /var/run/slurmctld.pid" - sed -i "s:/var/run/slurmdbd.pid:${EPREFIX}/run/slurm/slurmdbd.pid:g" \ + || die "Can't sed for /var/run/slurmctld.pid" + sed \ + -e "s:/var/run/slurmdbd.pid:${EPREFIX}/run/slurm/slurmdbd.pid:g" \ -i "${S}/etc/slurmdbd.conf.example" \ - || die "Can't sed for /var/run/slurmdbd.pid" - # also state dirs are in /var/spool/slurm - sed -e "s:StateSaveLocation=*.:StateSaveLocation=${EPREFIX}/var/spool/slurm:g" \ - -e "s:SlurmdSpoolDir=*.:SlurmdSpoolDir=${EPREFIX}/var/spool/slurm/slurmd:g" \ - -i "${S}/etc/slurm.conf.example" \ - || die "Can't sed ${S}/etc/slurm.conf.example for StateSaveLocation=*. or SlurmdSpoolDir=*" - # and tmp should go to /var/tmp/slurm - sed -e 's:/tmp:/var/tmp:g' \ - -i "${S}/etc/slurm.conf.example" \ - || die "Can't sed for StateSaveLocation=*./tmp" + || die "Can't sed for /var/run/slurmdbd.pid" # gentooify systemd services - sed -e 's:sysconfig/.*:conf.d/slurm:g' \ + sed \ + -e 's:sysconfig/.*:conf.d/slurm:g' \ -e 's:var/run/:run/slurm/:g' \ -i "${S}/etc"/*.service.in \ - || die "Can't sed systemd services for sysconfig or var/run/" + || die "Can't sed systemd services for sysconfig or var/run/" hprefixify auxdir/{ax_check_zlib,x_ac_{lz4,ofed,munge}}.m4 eautoreconf |