reboot/poweroff/halt not working

3 posts / 0 new
Last post
#1 Tue, 2017-11-14 17:21
yaron
  • yaron's picture
  • Offline
  • Last seen: 1 week 4 days ago
  • Joined: 2017-10-31

I'm not sure what's wrong nor where are the relevant logs to these commands (if any), can you guys give me a hint?

I managed to use poweroff -f and reboot -f yet I'm not sure this is the best approach for my system.

Furthermore, I think it happened after I've added start and stop scripts to /etc/local.d and ran rc-update add local default.

Thanks in advance!

Mon, 2017-11-27 05:09
ReproducibleBui...
  • ReproducibleBuildsAreAGoodStandard's picture
  • Offline
  • Last seen: 19 hours 29 min ago
  • Joined: 2017-05-05

One way is to add a line in the /etc/sudoers file for users with admin rights (for a user to be given admin rights, open a root terminal and do adduser myusername wheel; while doing visudo as root as in next step, uncomment the line "# %wheel ALL=(ALL) ALL" also, and your user will have sudo rights when next logged in). Use visudo to make sure that you do this correctly:

If not in a root terminal use:
sudo visudo
or if a root terminal, use
visudo

Then scroll down to the following paragraph

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

...and then add the following (type 'i' to insert)

%wheel ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot

Visudo uses vi text editor, I think, so you need to save the document with Esc and type :x
Then you can modify the shortcuts on your desktop for 'Shutdown', etc. to say sudo shutdown, etc. and you won't be asked for a password.
This may not be recommended for servers, etc. - I don't know about them - and maybe there are better ways; I'm not familiar with any polkit on Alpine Linux.

Tue, 2017-11-14 19:47
Head_on_a_Stick
  • Head_on_a_Stick's picture
  • Offline
  • Last seen: 2 weeks 4 days ago
  • Joined: 2016-05-01

For the logs, try /var/log/messages & /var/log/dmesg

It may be helpful to see the actual scripts that you have added to /etc/local.d/ (or links to them if they are lengthy).

Have you tried rc-update del local default to see if that reverts the system to the expected behaviour?

Log in or register to post comments