There is really never any compelling reason to use init 6
instead of reboot
, unless:
- For some reason you are missing the
reboot
executable, or
- You are deliberately trying to avoid notifying users that the system is going down.
reboot
(so long as you don't run reboot --force
) is actually the "softer" way to shut down.
Consider:
init 6
will run all of the shutdown scripts in /etc/init/rc.*
as it reduces system's runlevel
But the reboot
command, called without the --force
flag, only directly reboots the system (via the reboot
system call) when one of these two situations applies:
- The system is in runlevel 0 (single user mode), so there is no reduction of runlevel that can occur, so no shutdown scripts are automatically run.
- The system is in runlevel 6. What
init 6
does it to put the system in runlevel 6. Again, there's nothing running init 6
will do that running the reboot
command won't do.
Otherwise, sudo reboot
is equivalent to sudo shutdown -r now
. This does all the nice things sudo init 6
does, but also:
- notifies users that the system is going down.
- prevents new logins (though they probably wouldn't succeed anyway).
- is more intuitive and self-documenting than
sudo init 6
.
If you're on a system with only you logged in, and only local logins, there is nothing wrong with using init 6
to reboot. If that's how you prefer to reboot, then by all means, go ahead--you're not harming anything by doing so. But there's also nothing objectively preferable about doing it this way.
init
's own documentation says it's not the normal way to shut down or reboot the system. Consider that when init
is run by the user (like when you run sudo init 6
), it actually runs telinit
(see man init
). telinit
is what actually changes runlevels. And man telinit
tells us:
Normally you would use the shutdown(8) tool to halt or reboot
the system, or to bring it down to single-user mode.
The deluge docs have something similar to yours but I think this is a hangover from very old versions of Upstart. I'd try simplifying it down to something like this first:
description "Deluge daemon"
author "Deluge Team"
start on filesystem and static-network-up
stop on runlevel [016]
respawn
respawn limit 5 30
setuid debian-deluged
setgid debian-deluged
umask 007
exec /usr/bin/python /usr/bin/deluged -L info -l /var/log/deluged/server.log -c /var/opt/deluged/config -p 8112 -- -d
And then if that still doesn't work, check the permissions on /var/log/deluged/
and /var/log/deluged/server.log
(that the debian-deluged
user can write there). If it's still not working then, the upstart log files might help you out. Yours will be /var/log/upstart/deluged.log
. If that shows nothing, we could just try launching the command as the right user:
sudo -u debian-deluged -g debian-deluged /usr/bin/python /usr/bin/deluged -L info -l /var/log/deluged/server.log -c /var/opt/deluged/config -p 8112 -- -d
Best Answer
From the manpages:
Ubuntu and other modern Linux distributions have replaced
System V init
with Upstart:If you must switch to what is now closest to
runlevel 3
do it by stopping yourgdm
orlightdm
service.