Added support for slurm power
All checks were successful
Build / build (push) Successful in 24m52s

This commit is contained in:
Lukáš Plevač 2024-12-08 17:48:10 +01:00
parent 2afb412eca
commit f55c11d6bf
5 changed files with 42 additions and 14 deletions

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
echo "`date` User $USER invoked Resume $*" >>/var/log/slurm/power_save.log
sudo etherwake b0:83:fe:d8:a6:e0

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
echo "`date` User $USER invoked Suspend $*" >>/var/log/slurm/power_save.log
sshpass -p 4126 ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -t lukasplevac@10.0.0.101 "sudo /sbin/shutdown"

View File

@ -61,10 +61,16 @@ echo "UseDomains=true" >> /etc/systemd/network/20-wired.network
echo "Adding Users"
useradd -m -G wheel,users -s /bin/bash ${USER}
groupadd wheel
groupadd sudo
useradd -m -G users,sudo -s /bin/bash ${USER}
yes ${PASSWORD} | passwd
yes ${PASSWORD} | passwd ${USER}
echo "%sudo ALL=(ALL:ALL) ALL" >> /etc/sudoers
echo "%wheel ALL=(ALL:ALL) NOPASSWD ALL" >> /etc/sudoers
echo "Installing GRUB"
mkdir /boot/grub

View File

@ -21,7 +21,7 @@ pacman -Syy
pacman -S --noconfirm man-pages man-db dnsutils ethtool iputils net-tools iproute2 openssh wget \
usbutils usb_modeswitch tcpdump smartmontools gnu-netcat mc dosfstools exfat-utils \
partclone parted partimage gptfdisk iw dialog base-devel vim \
grub os-prober efivar efibootmgr efitools intel-ucode amd-ucode dmidecode htop nano python slurm-llnl nfs-utils saturn-discover lmod python-pipenv
grub os-prober efivar efibootmgr efitools intel-ucode amd-ucode dmidecode htop nano python slurm-llnl nfs-utils saturn-discover lmod python-pipenv saturn-power wol
cd /usr/bin/
ln -s vim vi
@ -57,10 +57,24 @@ echo "UseDomains=true" >> /etc/systemd/network/20-wired.network
echo "Adding Users"
useradd -m -G wheel,users -s /bin/bash ${USER}
groupadd wheel
groupadd sudo
useradd -m -G users,sudo -s /bin/bash ${USER}
yes ${PASSWORD} | passwd
yes ${PASSWORD} | passwd ${USER}
usermod -a -G wheel slurm
echo "%sudo ALL=(ALL:ALL) ALL" >> /etc/sudoers
echo "%wheel ALL=(ALL:ALL) NOPASSWD ALL" >> /etc/sudoers
useradd -m -G users,sudo -s /bin/bash maintenance
ssh-keygen -t ed25519 -C "maintenance" -f /root/.ssh/maintenance -N ''
mkdir /home/maintenance/.ssh
cat /root/.ssh/maintenance.pub >> /home/maintenance/.ssh/authorized_keys
echo "Installing GRUB"
mkdir /boot/grub
@ -106,6 +120,12 @@ sudo mkdir /clusterfs
sudo chown nobody.nogroup /clusterfs
sudo chmod -R 777 /clusterfs
mkdir /clusterfs/config
sudo chown root /clusterfs/config
sudo chmod -R 700 /clusterfs/config
cp /root/.ssh/maintenance.pub /clusterfs/config/maintenance.pub
# todo security check here
echo "/clusterfs (rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports
echo "/home (rw,sync,no_root_squash,no_subtree_check)" >> /etc/exports

View File

@ -57,10 +57,22 @@ echo "UseDomains=true" >> /etc/systemd/network/20-wired.network
echo "Adding Users"
useradd -m -G wheel,users -s /bin/bash ${USER}
groupadd wheel
groupadd sudo
useradd -m -G users,sudo -s /bin/bash ${USER}
yes ${PASSWORD} | passwd
yes ${PASSWORD} | passwd ${USER}
usermod -a -G wheel slurm
echo "%sudo ALL=(ALL:ALL) ALL" >> /etc/sudoers
echo "%wheel ALL=(ALL:ALL) NOPASSWD ALL" >> /etc/sudoers
useradd -m -G users,sudo -s /bin/bash maintenance
mkdir /home/maintenance/.ssh
echo "Installing GRUB"
mkdir /boot/grub