Startup scripts - Raspberry Pi Forums


hi all,

firstly, loving pi...i'm experimenting using receive rtsp stream webcam. have mplayer dumping named pipe, running omxplayer decode it.

wanna make sure happens on bootup, need pi automatically login user, , run mplayer, followed omxplayer...

have absolutely no skills bash, wondering if can help?

thanks

craig

a few things you'll want init script do:

start
startup portion of script should start application (in daemon mode or background process), store process id pid file , exist gracefully. might worth while check pid file first see if process running.

stop
checking pid file, you'll want kill process , delete file. pretty simple.

status
here check pid file, , display if process running or not.

restart
call stop, start.

arguments
last step catch single argument being passed script: start, stop, status, restart.

put pretty simple script. i'd recommend check out other init scripts in system find out exact nature of doing things storing pid, printing status screen, etc.

i'll post code tomorrow.


raspberrypi



Comments