This is on Proxmox VE 7.3 with Debian 11. I ran crontab -e
, added @reboot /home/onboot.sh
to the file, saved it, ensured cron is running with systemctl enable cron.service
and verified it's running at boot with systemctl status cron.service
.
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-02-08 17:16:52 EST; 11min ago
Docs: man:cron(8)
Main PID: 988 (cron)
Tasks: 1 (limit: 9394)
Memory: 1.1M
CPU: 25ms
CGroup: /system.slice/cron.service
└─988 /usr/sbin/cron -f
Feb 08 17:16:52 svr systemd[1]: Started Regular background program processing daemon.
Feb 08 17:16:52 svr cron[988]: (CRON) INFO (pidfile fd = 3)
Feb 08 17:16:52 svr cron[988]: (CRON) INFO (Running @reboot jobs)
Feb 08 17:16:52 svr CRON[994]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Feb 08 17:16:52 svr CRON[996]: (root) CMD (sleep 120 /home/onboot.sh)
Feb 08 17:16:52 svr CRON[994]: pam_unix(cron:session): session closed for user root
Feb 08 17:17:01 svr CRON[1063]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Feb 08 17:17:01 svr CRON[1064]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Feb 08 17:17:01 svr CRON[1063]: pam_unix(cron:session): session closed for user root
The onboot.sh
file contains the following:
#!/bin/bash
# Remove USB module or interrupt handler conflict with NIC stops qm 100
rmmod ehci_pci
rmmod ehci_hcd
I've tried to move the script file to /home
, /usr/local/bin
and /usr/local/sbin
, no luck. After 2 reboots, cron log shows:
Feb 8 17:08:13 svr cron[985]: (CRON) INFO (pidfile fd = 3)
Feb 8 17:08:13 svr cron[985]: (CRON) INFO (Running @reboot jobs)
Feb 8 17:08:13 svr CRON[993]: (root) CMD (sleep 120 /home/onboot.sh)
Feb 8 17:15:09 svr crontab[2206]: (root) BEGIN EDIT (root)
Feb 8 17:15:34 svr crontab[2206]: (root) END EDIT (root)
Feb 8 17:16:52 svr cron[988]: (CRON) INFO (pidfile fd = 3)
Feb 8 17:16:52 svr cron[988]: (CRON) INFO (Running @reboot jobs)
Feb 8 17:16:52 svr CRON[996]: (root) CMD (sleep 120 /home/onboot.sh)
Feb 8 17:17:01 svr CRON[1064]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
But that's it. If I run the script file normally as in bash /home/onboot.sh
, it executes perfectly fine. Permissions for /home/onboot.sh
are
-rwxr-xr-x 1 root root 150 Feb 8 17:14 /home/onboot.sh
What obvious oversight am I making?
sleep 120 /home/onboot.sh
? try that on the command line and see what happenssleep n
"cron job parameter" - do you have any documentation that describes these cron job parameters?/usr/bin:/bin
, butrmmod
is in/sbin
. Use the full path/sbin/rmmod
. Check your mail.rmmod
why not blacklist the modules and have them not load in the first place?