Skip to main content
Topic: init 0 and init 6 do nothing (Read 1569 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

init 0 and init 6 do nothing

Hi forum :-)

Coming from Gentoo, I use "init 0" to shutdown my system on the console and "init 6" to reboot it from the console. The same also works on Debian, Devuan etc.

On my new Artix/OpenRC installation, those two commands do nothing. Using "halt now" or "shutdown" and "reboot" instead works though.

Is it possible to use "init" for shutdown/reboot? Or why does "init" not do anything?

Thanks for all clarification!

Re: init 0 and init 6 do nothing

Reply #1
Hi forum :-)

Coming from Gentoo, I use "init 0" to shutdown my system on the console and "init 6" to reboot it from the console. The same also works on Debian, Devuan etc.

On my new Artix/OpenRC installation, those two commands do nothing. Using "halt now" or "shutdown" and "reboot" instead works though.

Is it possible to use "init" for shutdown/reboot? Or why does "init" not do anything?

Thanks for all clarification!

use loginctl, so  for example to shutdown issue loginctl poweroff

Re: init 0 and init 6 do nothing

Reply #2
Yeah, that would be another (systemd style) option.

But what about init?

Re: init 0 and init 6 do nothing

Reply #3
Well, i for one don't require artix to be like every other distro in how it operates.  I really like that it is in fact it's own unique easy to use distro.
Cat Herders of Linux

Re: init 0 and init 6 do nothing

Reply #4
Yeah, that would be another (systemd style) option.

But what about init?
Ok and? not everything systemd does is bad and the way that elogind does it is probably better

Besides what benefit is there to using init directly than to elogind?

If you did try init [0-9] and it didn't work, check the logs to see if you can find anything.

 

Re: init 0 and init 6 do nothing

Reply #5
Ok and? not everything systemd does is bad and the way that elogind does it is probably better
I didn't say anything about this being bad – only that it's another alternative to what I already found.

Don't get me wrong, I don't want Artix to be like other distros. I'm only interested why "init" simply does nothing. No entry in dmesg, nothing in the syslog. Simply nothing.

I only want to understand this, as using "init" for halting or rebooting the system is the traditional Linux way to do it iirc.

EDIT:

Okay, it seems that Gentoo itself (in contrast to Artix/OpenRC) is actually not using OpenRC's own init but sysvinit (cf. https://wiki.gentoo.org/wiki/OpenRC/openrc-init ). And apparently, OpenRC's own init does not support commands like "init 0" or "init 6". One has to use openrc-shutdown (which is, iirc, executed by "shutdown", "reboot" etc.).

Re: init 0 and init 6 do nothing

Reply #6
Don't get me wrong, I don't want Artix to be like other distros. I'm only interested why "init" simply does nothing. No entry in dmesg, nothing in the syslog. Simply nothing.
Well /usr/bin/init is just a symlink to whichever init binary (or script ?) you are using. In the case of openrc /usr/bin/openrc-init

And running it from the command line produces no output as you say.
It does have a man page if you wish to learn a little more about it.
Code: [Select]
man openrc-init

Quote
I only want to understand this, as using "init" for halting or rebooting the system is the traditional Linux way to do it iirc.
I'd say that was the SysVinit way of doing things not the Linux way of doing things. AFAIR the command init followed by a number changed the run level. Or was that telinit, or both ? I can't remember ? It's been a while.

Other Artix supported init's may handle the init command differently ? IDK, I use openrc.

Maybe Gentoo's version of openrc handles things differently than Artix if it was working there?






Re: init 0 and init 6 do nothing

Reply #7
Yeah, I think this is because Gentoo uses sysvinit.

From openrc-init's manpage:

     To use openrc-init configure your boot loader to invoke it or symlink it to /sbin/init.
     Also, you will need to use openrc-shutdown, to halt, reboot or poweroff the system.

     The default runlevel is read from the init command line, the rc_default_runlevel setting in
     rc.conf, the kernel command line, or it is assumed to be "default" if it is not set in any of
     these places.


Apparently, openrc-init does not know numbered runlevels. Seems to be a sysvinit thing. I didn't know that.