I have a simple script, that replays can frames:
#!/bin/bashsudo ip link set can0 up type can bitrate 500000canplayer -I test -l i
when running it manually using command ./startup_can.sh
it works completely fine: sending frames in the infinite loop
I used the crontab -e
and added the following line:
@reboot cd $HOME && ./startup_can.sh
and, it works fine at the beginning: After reboot, it starts doing the script job, but after 10-15seconds it suddenly stops.
I checked the journal log and it looks the following:
wojtas@malina:~ $ journalctl -u cron.service | tailJun 07 12:04:41 malina systemd[1]: Started cron.service - Regular background program processing daemon.Jun 07 12:04:41 malina cron[572]: (CRON) INFO (pidfile fd = 3)Jun 07 12:04:41 malina cron[572]: (CRON) INFO (Running @reboot jobs)Jun 07 12:04:41 malina CRON[590]: pam_unix(cron:session): session opened for user wojtas(uid=1000) by (uid=0)Jun 07 12:04:41 malina CRON[650]: (wojtas) CMD (cd $HOME && ./startup_can.sh)Jun 07 12:04:42 malina sudo[658]: wojtas : PWD=/home/wojtas ; USER=root ; COMMAND=/usr/sbin/ip link set can0 up type can bitrate 500000Jun 07 12:04:42 malina sudo[658]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)Jun 07 12:04:42 malina sudo[658]: pam_unix(sudo:session): session closed for user rootJun 07 12:05:29 malina CRON[590]: (CRON) info (No MTA installed, discarding output)Jun 07 12:05:29 malina CRON[590]: pam_unix(cron:session): session closed for user wojtas
at this point I have no idea why this job is being terminated after that short time...
any hints?