Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
# sasc-ng servicedescription "sasc-ng"author "espe"start on starting mythtv-backendstop on starting shutdownrespawnpre-start script rm -rf /usr/local/etc/ecm.cache echo `date +%s` > /tmp/MythTvInitialFillDBRun echo `date` "sasc init" >> /tmp/sasc-start sleep 8s insmod /root/sc/contrib/sasc-ng/dvbloopback.ko num_adapters=2 sleep 2send scriptexec /root/sc/contrib/sasc-ng/sasc-ng -j 0:2 -j 1:3 --cam-budget --cam-dir /usr/local/etc/ --sid-filt 12 --sid-allpid --sid-nocache --buffer 8M --pidfile /var/run/sasc-ng.pid --log /var/log/sasc-ng.logpost-start script echo `date` "sasc init post pre sleep" >> /tmp/sasc-startend scriptpost-stop script rmmod dvbloopbackend script
Can I add an exec line before that to execute a program first with a quick sleep inbetween?
Also how do I make the system run that script?
#!/bin/sh -e# upstart-job## Symlink target for initscripts that have been converted to Upstart.. /path/to/script.sh . /path/to/second/script.plset -eINITSCRIPT="$(basename "$0")"JOB="${INITSCRIPT%.sh}"
Don't hack into existing scripts if it is not necessary. That's the nice thing about upstart that you can put a script before something else without touching it.As you can see in my script I have also some sleeps etc. Actually I cleaned it up a bit and there was also a 'sleep 30s' in the post-start script to be sure that the adapters are up and running before mythtv-backend get's started. That will do the trick.