Artix Linux Forum

Init systems => runit => Topic started by: takase1121 on 29 May 2020, 16:32:36

Title: Unable to shutdown (with shutdown command, not power button)
Post by: takase1121 on 29 May 2020, 16:32:36
I was unable to shutdown with
Code: [Select]
shutdown now
. Nothing happens after a while when it attempted to shutdown (The system isn't freezed or anything, prompt still works)

I cycled through my tty and tty7 still responding, although it told me that the system is shutting down.

I managed to dump some logs with dmesg:
pastebin here (https://pastebin.com/raw/qj3yE4Lk)

and shutdown just tells me this:
Code: [Select]
runsvchdir: single: current.
Seems like normal stuff.


Anyone has clues?

and I just noticed dmesg doesn't help that much, here is a photo of tty0
(https://i.imgur.com/CCAutti.jpg)
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: phoenix_king_rus on 29 May 2020, 18:00:06
Does runit even have shutdown command like this? I thought it can only work via poweroff or runit-init 0
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: takase1121 on 30 May 2020, 04:12:15
interesting... Now I will need to find where the heck this executable comes from.
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: takase1121 on 30 May 2020, 04:14:26
Code: [Select]
pacman -F shutdown
system/mkinitcpio 27-3 [installed]
    usr/lib/initcpio/hooks/shutdown
    usr/lib/initcpio/install/shutdown
    usr/lib/initcpio/shutdown
system/openrc 0.42.1-13
    usr/bin/shutdown
    usr/lib/openrc/bin/shutdown
system/runit 2.1.2-19 [installed]
    usr/bin/shutdown
system/s6-linux-init 1.0.4.0-2
    etc/s6/current/bin/shutdown
    usr/bin/shutdown
archlinuxcn/systemd-sysvcompat-git 245.1099-1
    usr/bin/shutdown

It was installed with runit.
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: takase1121 on 30 May 2020, 04:37:59
After some investigation, I suspect that runit isn't exiting stage 3 properly. Maybe one of the service file is to blamed.
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: konimex on 02 June 2020, 16:28:20

The command should be shutdown -h now. I need to update the documentations sometimes.

Anyway, a good alternative command would be poweroff.
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: KoO-i3 on 27 June 2020, 06:14:43
Both these work too.

sudo halt
sudo reboot
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: pshaw on 14 August 2020, 05:36:07
Not sure if necro-bumbing is allowed, but this is an issue for me as well.  Question:  Why isn't the contents of /usr/bin/shutdown installed by runit a file containing simply: 

Code: [Select]
#! /bin/sh
runit-init 0

I had that as the contents of my shutdown executable for a while but the next time  runit updated via pacman -Syu it reverted to the broken non-system-shutdowning monstrosity.

Any chance this can be the default behavior of runit's shutdown file?

Thanks
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: konimex on 14 August 2020, 10:54:30
Not sure if necro-bumbing is allowed, but this is an issue for me as well.  Question:  Why isn't the contents of /usr/bin/shutdown installed by runit a file containing simply: 

Code: [Select]
#! /bin/sh
runit-init 0

I had that as the contents of my shutdown executable for a while but the next time  runit updated via pacman -Syu it reverted to the broken non-system-shutdowning monstrosity.

Any chance this can be the default behavior of runit's shutdown file?

Thanks

Unfortunately, no. Since the sysvinit days, shutdown without option will bring us to a single-user login, and I think Artix should keep it consistent.

From Debian manpage for sysvinit (https://manpages.debian.org/testing/sysvinit-core/shutdown.8.en.html):

Quote
runlevel 1 is used to put to system into a state where administrative tasks can be performed; this is the default if neither the -h or -r flag is given to shutdown.
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: ####### on 14 August 2020, 20:58:14
You can make your personal default though:
man pacman.conf
       NoUpgrade = file ...
           All files listed with a NoUpgrade directive will never be touched during a package install/upgrade, and the new files will be installed with a .pacnew extension.
           These files refer to files in the package archive, so do not include the leading slash (the RootDir) when specifying them. Shell-style glob patterns are allowed.
           It is possible to invert matches by prepending a file with an exclamation mark. Inverted files will result in previously blacklisted files being whitelisted
           again. Subsequent matches will override previous ones. A leading literal exclamation mark or backslash needs to be escaped.

e.g. in /etc/pacman.conf (remember no / prefix )
NoUpgrade   = etc/path/to/file
Title: Re: Unable to shutdown (with shutdown command, not power button)
Post by: nephitejnf on 15 August 2020, 19:27:19
Try
Code: [Select]
loginctl poweroff