SOLVED Script problem in "/usr/local/sbin/reboot"

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,636
Reaction score
523
Crontab for a nightly reboot fails due to dirty bit

I tried a crontab -e code below - to do a nightly reboot
Code:
0 4 * * *  /usr/local/sbin/reboot
Problem is that fsck is called by the /etc/init.d/reboot script; such that the fsck check fails due to the dirty bit being set and fsck fails to fix it, but opens a Maintenance shell that requires human input to fix the problem (at 4am?) and then to exit with ctrl+D to allow the restart to continue.

I found that when I burnt raspbian8 jessie image to sdb, the dirty bit was set in the burned image. which prevented a crontab reboot. That asside this also happens with a dirty bit on Rpi /dev/mmcblk0p1

Ayone know how I stop the Maintenance shell opening?
 

Attachments

  • DirtyBitinRasp8JessieImagetxt.txt
    2.3 KB · Views: 2

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
The sixth column of /etc/fstab specifies whether fsck should run against the volume at boot.

Find the line in fstab and set the sixth column to 0.

"man fstab" for more info.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,227
Not sure why it would be different, but we regularly do this without problems with an entry in /etc/crontab:
Code:
30 1 * * * root /usr/local/sbin/reboot >/dev/null 2>&1
 

Members online

No members online now.

Forum statistics

Threads
25,821
Messages
167,814
Members
19,247
Latest member
mdauck
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top