View previous topic :: View next topic |
Author |
Message |
NUIL n00b
Joined: 03 Sep 2018 Posts: 43
|
Posted: Mon Sep 03, 2018 6:19 am Post subject: How to poweroff reboot suspend and hibernate? |
|
|
How to poweroff reboot suspend and hibernate as ordinary user?
I'm using reboot poweroff pm-suspend and pm-hibernate as root, but what should I do to run this as ordinary user?
I have tried visuo and add something like this:
Code: | nil ALL = /sbin/poweroff, /usr/sbin/pm-suspend |
But it doesn't work at all.
Please tell me what should I do. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Mon Sep 03, 2018 9:41 am Post subject: |
|
|
NUIL ...
when using sudo you retain the PATH for the user runing sudo, and by default /sbin (where poweroff is located) isn't in that PATH. I expect this is the issue (though providing the exact command, and output, is always recommended). That being the case either use 'sudo /sbin/poweroff' or add /sbin to path (and so execute 'sudo poweroff').
bash:
~/bash_profile: | export PATH="$PATH:/sbin" |
zsh:
~/.zprofile: | if [[ $EUID != 0 ]] && (($+commands[sudo])) ; then
typeset -xT SUDO_PATH sudo_path
typeset -U sudo_path
sudo_path=({,/usr/local,/usr}/sbin(N-/))
fi |
~/.zshrc: | zstyle ':completion:*:sudo:*' environ PATH="$SUDO_PATH:$PATH" |
HTH & best ... khay |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|