I have a script that starts on desktop-session-start. The first person who logs in graphically after a boot will have this script called. I want it called once, not every time a person logs in. How do I make a script perform just once?
# one time script
start on desktop-session-start
stop on somebodystopme
script
...
end script
Use
post-start script
section instead ofscript
section. It will leave the job asstarted/running
state and it will not be re-run.This assumes Ubuntu 11.10 or later. Use /var/run for earlier releases. /run is cleared after every reboot, so this will be run again on the next boot, but never again. It will stop normally after the touch statement, so there's no need for a 'stop on'.