I have a situation where I'm looking to run a service restart
a couple minutes after startup. The particulars as to why are as follows, but the essense of my question is basically captured in in that first sentence; how might I automatically execute a command some time after startup?
The details:
I'm using boinc in conjunction with my cuda-enabled graphics card. It all works great, except for the fact that when I start up my computer fresh I get a gpu missing
error in the boinc manager. This is easily fixed with a sudo service boinc-client restart
but this needs to be done whenever the computer starts up in order to engage the GPU. My hunch is that boinc is starting before the necessary graphics card drivers load. (Seems reasonable, right?) Anyway, if you know a more elegant way than I've proposed above to resolve this, I'm all ears but, as far as I'm concerned, restarting boinc like 2 minutes after the computer starts up is good enough for me.
Thanks for any insight!
Stick the command in /etc/rc.local which gets executed after all the other start-up stuff. You could put a "sleep 5" before it too to delay 5 seconds more for example. No need for sudo if rc.local as it is executed as root.