ab cd
Senior Member
Sometimes it's necessary to give the full path, like this 'sudo /sbin/reboot'. Might help.
Problem was not with path, it was due to typing alphabet o instead of numeral 0.I recall that sudo/sbin/reboot is prefered over sudo reboot as the pi will prepare itself first and execute a clean reboot so that is why I used it in my crontab every hour, on the hour,every day, every week.
The pi2 unit running d1090 + 4 feeders completes the reboot in 20-25 secs typically.
I know it probably has log entries building for this timed task in var/log and i have not bothered to log rotate but i have a 32gb class10 sd and to date "df" tells me i have used 21% of the space available s i have some time to go before capacity is a concern.
After changing alphabets o o by numerals 0 0 in entry 0 0,6,12,18 * * * sudo reboot, the RPi started rebooting as scheduled.
When a command is run as root, files inside the sbin folder have a higher priority than the other folders in the path.
That is why when command sudo reboot is given, sudo automatically chooses /sbin/reboot.
Later addition:
If you check your sudoers file in /etc, you will find the default path given there.
Code:
pi@raspberrypi ~ $ sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
pi ALL=(ALL) NOPASSWD: ALL
pi@raspberrypi ~ $
Last edited: