Score:0

`vbetool dpms off` not working from crontab

in flag

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.

Michael Hampton avatar
cz flag
This question appears to be off topic: We don't accept home computer questions. You may be able to get help at our sister site [unix.se].
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.