RemainAfterExit in Upstart
Is there an Upstart equivalent to systemd's RemainAfterExit?
I have an upstart task that exec's a script that completes quickly when the task is started. However, I would still like that task to report as active so that I can subsequently 'stop' the task and have it execute a cleanup script.
In systemd, I would do the following:
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/my_script.sh create %i
ExecStop=/usr/local/bin/my_script.sh delete %i
How would I do the same thing in Upstart?
You could either add one read
statement at the end of your script to pause execution or you could use pre-start exec
instead of exec
as suggested here (although I can't confirm the effectiveness of this solution).