diff options
Diffstat (limited to 'slurm-llnl-dev.install')
-rw-r--r-- | slurm-llnl-dev.install | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/slurm-llnl-dev.install b/slurm-llnl-dev.install index a7b47458a4e3..6a5b576e78c4 100644 --- a/slurm-llnl-dev.install +++ b/slurm-llnl-dev.install @@ -1,73 +1,73 @@ ## arg 1: the new package version post_install() { - id slurm >&/dev/null - if [ $? -ne 0 ]; then - echo -e "\e[34;1m==>\e[39;1m Adding slurm system group... \e[0m" - groupadd -g 64030 -r slurm - [ $? -ne 0 ] && groupadd -r slurm + id slurm >&/dev/null + if [ $? -ne 0 ]; then + echo -e "\e[34;1m==>\e[39;1m Adding slurm system group... \e[0m" + groupadd -g 64030 -r slurm + [ $? -ne 0 ] && groupadd -r slurm - echo -e "\e[34;1m==>\e[39;1m Adding slurm system user... \e[0m" - useradd -r -c "Slurm Daemon" -d /var/log/slurm-llnl -g slurm -u 64030 slurm - [ $? -ne 0 ] && useradd -r -c "Slurm Daemon" -d /var/log/slurm-llnl -g slurm slurm + echo -e "\e[34;1m==>\e[39;1m Adding slurm system user... \e[0m" + useradd -r -c "Slurm Daemon" -d /var/log/slurm-llnl -g slurm -u 64030 slurm + [ $? -ne 0 ] && useradd -r -c "Slurm Daemon" -d /var/log/slurm-llnl -g slurm slurm - echo -e "\e[34;1m==>\e[39;1m Locking Slurm User Account...\e[0m" - passwd -l slurm &>/dev/null - fi + echo -e "\e[34;1m==>\e[39;1m Locking Slurm User Account...\e[0m" + passwd -l slurm &>/dev/null + fi - # securing the log dir - if [ -d /var/log/slurm-llnl ]; then - chown -R slurm:slurm /var/log/slurm-llnl - fi + # securing the log dir + if [ -d /var/log/slurm-llnl ]; then + chown -R slurm:slurm /var/log/slurm-llnl + fi - echo -e "\e[34;1m==>\e[39;1m NOTE: You have to create a slurm configuration-file in /etc/slurm-llnl/ \e[0m" - echo -e "\e[34;1m==>\e[39;1m prior to starting any slurm daemons. \e[0m" - echo -e "\e[34;1m==>\e[39;1m NOTE: In order for new optional dependencies to be taken into account \e[0m" - echo -e "\e[34;1m==>\e[39;1m slurm-llnl has to be recompiled. \e[0m" + echo -e "\e[34;1m==>\e[39;1m NOTE: You have to create a slurm configuration-file in /etc/slurm-llnl/ \e[0m" + echo -e "\e[34;1m==>\e[39;1m prior to starting any slurm daemons. \e[0m" + echo -e "\e[34;1m==>\e[39;1m NOTE: In order for new optional dependencies to be taken into account \e[0m" + echo -e "\e[34;1m==>\e[39;1m slurm-llnl has to be recompiled. \e[0m" } ## arg 1: the new package version ## arg 2: the old package version post_upgrade() { - echo -e "\e[34;1m==>\e[39;1m NOTE: In order for new optional dependencies to be taken into account \e[0m" - echo -e "\e[34;1m==>\e[39;1m slurm-llnl has to be recompiled. \e[0m" + echo -e "\e[34;1m==>\e[39;1m NOTE: In order for new optional dependencies to be taken into account \e[0m" + echo -e "\e[34;1m==>\e[39;1m slurm-llnl has to be recompiled. \e[0m" - # THIS HAS TO BE REMOVED ONEDAY - TODO - if [ -f /etc/slurm/slurm.conf ]; then - mv /etc/slurm/* /etc/slurm-llnl/ - rmdir /etc/slurm - echo -e "\e[34;1m==>\e[39;1m Your configuration-files were moved from /etc/slurm to /etc/slurm-llnl ! \e[0m" - fi + # THIS HAS TO BE REMOVED ONEDAY - TODO + if [ -f /etc/slurm/slurm.conf ]; then + mv /etc/slurm/* /etc/slurm-llnl/ + rmdir /etc/slurm + echo -e "\e[34;1m==>\e[39;1m Your configuration-files were moved from /etc/slurm to /etc/slurm-llnl ! \e[0m" + fi } ## arg 1: the old package version pre_remove() { - which systemctl >& /dev/null - if [ $? -eq 0 ]; then - echo -e "\e[34;1m==>\e[39;1m Stopping slurm daemons through SystemD... \e[0m" - systemctl stop slurmd.service - systemctl stop slurmdbd.service - systemctl stop slurmctld.service + which systemctl >& /dev/null + if [ $? -eq 0 ]; then + echo -e "\e[34;1m==>\e[39;1m Stopping slurm daemons through SystemD... \e[0m" + systemctl stop slurmd.service + systemctl stop slurmdbd.service + systemctl stop slurmctld.service - echo -e "\e[34;1m==>\e[39;1m Disabling SystemD related file(s)... \e[0m" - systemctl disable slurmd.service - systemctl disable slurmdbd.service - systemctl disable slurmctld.service - else - echo -e "\e[34;1m==>\e[39;1m Stopping slurm daemons... \e[0m" - /etc/rc.d/slurm stop - /etc/rc.d/slurmdbd stop - fi + echo -e "\e[34;1m==>\e[39;1m Disabling SystemD related file(s)... \e[0m" + systemctl disable slurmd.service + systemctl disable slurmdbd.service + systemctl disable slurmctld.service + else + echo -e "\e[34;1m==>\e[39;1m Stopping slurm daemons... \e[0m" + /etc/rc.d/slurm stop + /etc/rc.d/slurmdbd stop + fi } ## arg 1: the old package version post_remove() { - echo -e "\e[34;1m==>\e[39;1m Removing slurm system user/group... \e[0m" - userdel slurm + echo -e "\e[34;1m==>\e[39;1m Removing slurm system user/group... \e[0m" + userdel slurm - # deleting remnant recusivly (there shell be now links!) - rm -rf /var/lib/slurm-llnl + # deleting remnant recusivly (there shell be now links!) + rm -rf /var/lib/slurm-llnl - # notifying the user of kept dirs - [ -d /etc/slurm-llnl ] && echo -e "\e[34;1m==>\e[39;1m NOTE: Custom configuration-file(s) in /etc/slurm-llnl/ were kept on your system.\e[0m" - [ -d /var/log/slurm-llnl ] && echo -e "\e[34;1m==>\e[39;1m NOTE: Logfiles were preserved. They reside under /var/log/slurm-llnl .\e[0m" + # notifying the user of kept dirs + [ -d /etc/slurm-llnl ] && echo -e "\e[34;1m==>\e[39;1m NOTE: Custom configuration-file(s) in /etc/slurm-llnl/ were kept on your system.\e[0m" + [ -d /var/log/slurm-llnl ] && echo -e "\e[34;1m==>\e[39;1m NOTE: Logfiles were preserved. They reside under /var/log/slurm-llnl .\e[0m" } |