Run a script automatically during shutdown or reboot? - Raspberry Pi Forums
i'm using raspberry couple pi's stream footage ip security cameras using omxplayer.
in case streams lost, have cron job runs every minute restart stream if it's not running.
unfortunately, open stream prevents rpi rebooting or shutting down, , if kill process, cron fires before can issue reboot/shutdown commands.
so, i'm wondering if there way execute script runs when issue reboot or shutdown commands automatically kill omxplayer.bin process... know use bash aliases, i'm used reboot/shutdown syntax other rpi projects, confusing have remember different command.
thoughts?
in case streams lost, have cron job runs every minute restart stream if it's not running.
unfortunately, open stream prevents rpi rebooting or shutting down, , if kill process, cron fires before can issue reboot/shutdown commands.
so, i'm wondering if there way execute script runs when issue reboot or shutdown commands automatically kill omxplayer.bin process... know use bash aliases, i'm used reboot/shutdown syntax other rpi projects, confusing have remember different command.
thoughts?
what stop cron before shutting down, kill program , halt or reboot:
code: select all
/sbin/service crond stop
raspberrypi
Comments
Post a Comment