On Wed, 13 Jun 2018 16:44:27 -0300 Jesse Smith <jsm...@resonatingmedia.com> wrote:
> On 06/13/2018 04:08 PM, Matias Fonzo wrote: > > > > That explain why it can't determine the runlevel. The file exists, > > but it is a limitation of the libc, in our case (Dragora -devel), we > > are using Musl. See > > https://wiki.musl-libc.org/faq.html#Q:-Why-is-the-utmp/wtmp-functionality-only-implemented-as-stubs? > > > > This is interesting. We may have to look into a way for the shutdown > process to get runlevels without using utmp. Perhaps init could write > the runlevel directly to a file, such as /var/run/runlevel to work > around situations like this. > According to init(8): [..] ENVIRONMENT Init sets the following environment variables for all its children: RUNLEVEL The current system runlevel. [..] Probably there is no need to write/read such file... > > >> Alternatively, you can try using the "shutdown" command in place of > >> "halt". Running "shutdown -P -h now" is approximately the > >> equivalent of using "halt". > > The command used was 'reboot'. > > > > If I'm not mistaken, the reboot command is just a link to the halt > binary. So I'd still like to find out if using shutdown will work > where halt/reboot fail. > > >