config/yadm/bootstrap: improve service & sudoers

This commit is contained in:
xerus2000 2020-11-13 13:34:30 +01:00
parent 0184ef2ace
commit 1ddbd75d06
1 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ highlight "Default sudoers configuration"
echo "Defaults editor=/usr/bin/nvim" | sudo tee /etc/sudoers.d/editor echo "Defaults editor=/usr/bin/nvim" | sudo tee /etc/sudoers.d/editor
echo "Defaults timestamp_timeout=20" | sudo tee /etc/sudoers.d/timeout echo "Defaults timestamp_timeout=20" | sudo tee /etc/sudoers.d/timeout
highlight "password-free reboot" highlight "password-free reboot"
echo "$USER ALL = NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff" | sudo tee /etc/sudoers.d/shutdown echo "$USER ALL = NOPASSWD: /sbin/halt, /sbin/reboot, /usr/sbin/reboot, /sbin/poweroff, /usr/sbin/shutdown" | sudo tee /etc/sudoers.d/shutdown
highlight "Reduce system startup & shutdown timeout" highlight "Reduce system startup & shutdown timeout"
sudo mkdir -p /etc/systemd/system.conf.d /etc/systemd/user.conf.d sudo mkdir -p /etc/systemd/system.conf.d /etc/systemd/user.conf.d
@ -66,8 +66,8 @@ echo " 0,20,40 * * * * janek pgrep workrave || XAUTHORITY='$XDG_CACHE_HOME/Xaut
highlight "Cron logging" highlight "Cron logging"
echo 'cron.* /var/log/cron.log' | sudo tee /etc/rsyslog.d/60-cron.conf echo 'cron.* /var/log/cron.log' | sudo tee /etc/rsyslog.d/60-cron.conf
alias hasService="which service 2>/dev/null" hasService=$(which service 2>/dev/null)
hasService && sudo service rsyslog restart || sudo systemctl restart rsyslog test "$hasService" && sudo service rsyslog restart || sudo systemctl restart rsyslog
highlight "Reload cron" highlight "Reload cron"
hasService && sudo service cron reload || sudo systemctl reload cronie test "$hasService" && sudo service cron reload || sudo systemctl reload cronie