"But what about setting up a particular job for yourself? You keep your job definitions in /etc/init/jobs.d, and they should be plain text files, and not executable. Your job needs to have either an exec line:
exec /bin/echo "ping"
"giving a path to a binary, and the arguments to pass to it; or a script section, as in the runlevel 3 job description above, which has a shell script to be run with /bin/sh. These define what will be run when the job is triggered. Jobs can be set to respawn with the line:
respawn
"There's an automatic limit set to this: if a process is respawned more than 10 times within 5 seconds, it will be stopped and not restarted. You can alter this default with:
respawn limit 20 5"