Aug 28, 2018 11:45
This answer is obsolete. The word now appears in dictionaries and google searches and is in common use in the software workplace. dictionary.com/browse/performant dictionary.cambridge.org/us/dictionary/english/performant performantcorp.com
 
Jan 6, 2015 21:16
I have updated my answer with what I've communicated to you. Would appreciate you marking it as "Answered". Cheers.
Jan 6, 2015 21:15
One advantage of the RC approach is that it would be portable to any Linux distro. Upstart is Ubuntu-specific. Everybody else uses Systemd (and Ubuntu will also, some day - Upstarts days are numbered).
Jan 6, 2015 21:14
Lol you'd be better off with Upstart, which will start your service immediately if it terminates unexpectedly. But that'll work. If you want to finess it, you can run "strace -o /tmp/strace.out -f YOUR_SCRIPT". Then look at /tmp/strace.out and see how many fork() calls there are. Then you could craft a proper Upstart script which would immediately restart your service when it dies.
Jan 6, 2015 20:59
Sure, let me write something more concise. Does this mean it's working for you?
Jan 6, 2015 20:54
Note that these simple RC scripts will start a service. They will not restart it if it dies. If you really need to do that manually (i.e. if the service itself doesn't handle the restarting), you will have to use Upstart directly as we started to discuss. But this can be a good test to see how far you can get with the simpler approach.
Jan 6, 2015 20:50
(I mean INIT INFO contents)
Jan 6, 2015 20:49
That instruments your RC script into the necessary runlevels for boot time, based on the contents of the INIT INFO script
Jan 6, 2015 20:49
So once you've edited your file, say it's called foobar (probably your Provides should match the file name), you can run: update-rc.d foobar enable
Jan 6, 2015 20:48
Sorry - forgot a step. Yes the init info is used by update-rc.d. Documentation is here: wiki.debian.org/LSBInitScripts
Jan 6, 2015 20:41
I've never used chat before, and don't know how notifications work. I'll be working in another window so might not see your response, when it comes. I've enabled "desktop notification", whatever that is, so hopefully I will.
Jan 6, 2015 20:37
Reboot your system, and let me know how it goes.
Jan 6, 2015 20:37
That's it.
Jan 6, 2015 20:36
4. Change the lines in the start) block to run your scripts. Leave the ";;" at the end.
Jan 6, 2015 20:36
test -f /usr/sbin/pppconfig || exit 0
mkdir /var/run/pppconfig >/dev/null 2>&1 || true
test -f /etc/ppp/ip-down.d/0dns-down || exit 0
Jan 6, 2015 20:36
3. Delete these lines:
Jan 6, 2015 20:35
(basically change everything but Default-Start)
Jan 6, 2015 20:34
2. Edit the file. Change the INIT INFO section by altering the descriptions and clearing out the Required-Start and Required-Stop fields. Make a new name for Provides.
Jan 6, 2015 20:33
1. Go to /etc/init.d, and make a copy of dns-clean (rename it as you like).
Jan 6, 2015 20:33
In fact, let's just try it. We'll just use the RC mechanism (which Upstart runs, but it's a simpler, legacy mechanism):
Jan 6, 2015 20:29
If they do, then it's just a question of ensuring they start at boot time. Easily done. Let me know.
Jan 6, 2015 20:28
Often, processes that background themselves will do their own monitoring/restarting if they die for some reason. Are you sure these do not?
Jan 6, 2015 20:24
Unfortunately that's not so easy. You'd need to use strace. Is there a man page? Is there an option to run it in foreground? I'm going to try moving this discussion to chat, as StackExchange keeps nudging us to do.
Jan 6, 2015 20:24
You'll have to do your own footwork. I won't research it for you. Try running it by hand. Do you get a shell prompt, while it runs in background, or does it keep running in the foreground?
Jan 6, 2015 20:24
Well, at a guess I'd say you don't want it to start if you stop it manually :-). This is the sort of thing Upstart does very easily. I'll update my answer with an example. You do need to know something about how the service starts: i.e. does it just run in the foreground? Or does it fork itself into the background? Does it fork twice (this is common for some services)?
Jan 6, 2015 20:24
Do you really need events? Or do you just want to run a job that gets started at boot and restarted when it dies? Maybe you can be more specific about what kind of events you want to handle, and the relationship/dependencies of your job to other jobs on the system (if any).
Jan 6, 2015 20:24
Yes Upstart should be installed on any base Ubuntu distro. You can verify by doing: "dpkg-query -l upstart"