Page 1 of 1

Reboot or sudo reboot?

Posted: Wed Jun 01, 2016 11:18 am
by windy54
Hi,
Ever since I have had a raspberry PI and using raspbian, from a terminal window I have always typed sudo reboot.

Just found out that you only have to type reboot, shutdown you always need sudo in front.

Out of interest, has this always been the case or has it changed in one of the releases?

Steve

Re: Reboot or sudo reboot?

Posted: Wed Jun 01, 2016 4:55 pm
by MarkHaysHarris777
This depends somewhat particularly if we're talking about the RPi, and if you're the pi user...

... this depends on what you know about sysvinit vs systemd. These two facilities are used to control the control of the system, init. The old way was sysvinit. The new way, beginning with Jessie, is systemd. The reason is that debian switched to systemd with Jessie 8. Raspbian Jessie followed suit.

reboot, halt, shutdown, and poweroff all symbolically link to systemctl. So, for instance:

sudo systemctl poweroff

... is the 'actual' command on Jessie, with systemd. Similarly with halt, and reboot.

How the implementers went from sysvinit to systemd (using systemctl) is a detail that leaves some scratching their heads... why? what? &c

The best thing I can recommend for you is to study systemd, particularly systemctl &c

Re: Reboot or sudo reboot?

Posted: Sat Jun 04, 2016 8:18 pm
by pcmanbob
It seems there may be a difference between reboot and sudo reboot.

just updated crontabe for the root user using sudo crontabe -e
once I had done did a reboot command with NO sudo.
Pi rebooted ok but cron @reboot commands for root user were not processed.
I had to use sudo reboot to make the cron @reboot commands for the root user work.
some thing to be aware of maybe.

Re: Reboot or sudo reboot?

Posted: Sun Jun 05, 2016 1:28 am
by dgordon42
windy54 wrote:Out of interest, has this always been the case or has it changed in one of the releases?
It changed in the 27 May release.
Relase notes.

Dave.

Re: Reboot or sudo reboot?

Posted: Sun Jun 05, 2016 3:42 pm
by windy54
thanks for the replies, I will start reading the release notes in future! ( well, maybe)

Steve