Fix shutdown command by using full path to /sbin/shutdown
Updated shutdown and reboot commands to use absolute paths to ensure they work correctly with the sudoers configuration. Also updated the sudoers file to allow shutdown with specific arguments. Changes: - Use /sbin/shutdown instead of just shutdown - Use /sbin/reboot instead of just reboot - Updated sudoers to allow both 'shutdown -h +1' and 'shutdown -h now' - Ensures commands match sudoers whitelist exactly The restart was working because reboot might be in PATH, but shutdown needs the full path to match the sudoers entry. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,5 +4,6 @@
|
||||
# Then: sudo chmod 0440 /etc/sudoers.d/wedding-phone-shutdown
|
||||
|
||||
# Allow user to run shutdown and reboot commands without password
|
||||
berwn ALL=(ALL) NOPASSWD: /sbin/shutdown
|
||||
berwn ALL=(ALL) NOPASSWD: /sbin/shutdown -h +1
|
||||
berwn ALL=(ALL) NOPASSWD: /sbin/shutdown -h now
|
||||
berwn ALL=(ALL) NOPASSWD: /sbin/reboot
|
||||
|
||||
Reference in New Issue
Block a user