I have an old laptop I'm using to host a home Debian server. I'd like to switch the screen off at boot, so I put
@reboot vbetool dpms off
in the root crontab (sudo crontab -e
). It looks like it runs as expected (see troubleshooting below) but the screen doesn't switch off. Also, when I run vbetool dpms off
from SSH it works as expected.
Do anyone have any suggestion?
Troubleshooting results following this answer. Please ask if more details are necessary.
Look at the logs (boot at 10:00:00)
sudo cat /var/log/cron.log
:
...
Jul 12 10:00:00 my_hostname cron[457]: (CRON) INFO (pidfile fd = 3)
Jul 12 10:00:00 my_hostname anacron[461]: Anacron 2.3 started on 2021-07-12
Jul 12 10:00:00 my_hostname anacron[461]: Normal exit (0 jobs run)
Jul 12 10:00:00 my_hostname cron[457]: (CRON) INFO (Running @reboot jobs)
Jul 12 10:00:01 my_hostname CRON[487]: (root) CMD (vbetool dpms off)
Jul 12 10:00:01 my_hostname CRON[480]: (CRON) info (No MTA installed, discarding output)
Jul 12 10:00:05 my_hostname systemd-timesyncd[515]: Synchronized to time server for the first time 192.168.178.1:123 (192.168.178.1).
sudo cat /var/log/syslog
:
...
Jul 12 10:00:00 my_hostname systemd[1]: Started Trigger anacron every hour.
Jul 12 10:00:00 my_hostname cron[457]: (CRON) INFO (pidfile fd = 3)
Jul 12 10:00:00 my_hostname systemd[1]: Started Run anacron jobs.
Jul 12 10:00:00 my_hostname anacron[461]: Anacron 2.3 started on 2021-07-12
Jul 12 10:00:00 my_hostname anacron[461]: Normal exit (0 jobs run)
Jul 12 10:00:00 my_hostname cron[457]: (CRON) INFO (Running @reboot jobs)
Jul 12 10:00:00 my_hostname systemd[1]: anacron.service: Succeeded.
Check that cron is running
ps -ef | grep cron | grep -v grep
outputs
root 474 1 0 10:00 ? 00:00:00 /usr/sbin/cron -f
The last command in my crontab doesn't run
The file ends with an empty line.
Command output
I edited the command to
@reboot vbetool dpms off &>/tmp/mycrontablog.log
but mycrontablog
remains empty.