<div dir="ltr">Hi Chris,<br><div class="gmail_extra"><br><div class="gmail_quote">2014-03-13 13:33 GMT+00:00 Chris Warner <span dir="ltr"><<a href="mailto:cwarner@thorlo.com" target="_blank">cwarner@thorlo.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I am trying to find out what the required files to create an upstart job are, but so far I can find very little, and I am stuck trying to get a service running.<br>
<br>
I see .conf files in /etc/init I see links and links to other scripts in /etc/init.d.<br></blockquote><div>These links allow a purely Upstart job from being controlled by the SysV service(8) command. Debian and Ubuntu packaging tools handle creating such links automatically, although as of Debian Jessie and Ubuntu Saucy the links are not required (although you will need to create them if you wish to call service rather than the upstart equivalents start(8), stop(8), etc.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I have a service I am trying to setup, and when I run service I don't see my service listed...</blockquote><div>As mentioned, service(8) is not an upstart command. What does "sudo status myjob" show?</div><div>
<br></div><div><a href="http://upstart.ubuntu.com/cookbook/#initctl-status">http://upstart.ubuntu.com/cookbook/#initctl-status</a><br></div><div><br></div><div> </div><div>
Upstart will automatically detect any new jobs as soon as they are created in /etc/init/, so assuming you put the configuration for your service in that directory as "myjob.conf" (must end in '.conf'), and the job is valid, status(8) should show your job. If not, your job may be invalid - try running 'init-checkconf /etc/init/myjob.conf'. See:</div>
<div><br></div><div> <a href="http://upstart.ubuntu.com/cookbook/#init-checkconf" target="_blank">http://upstart.ubuntu.com/cookbook/#init-checkconf</a></div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
The documentation shows a lot of pieces, but I don't see the a basic 'this is what you have to do to create a service'<br></blockquote><div>That's because every service is different :) Take a look at the following though to get your started:</div>
<div><br></div><div><a href="http://upstart.ubuntu.com/cookbook/#exec">http://upstart.ubuntu.com/cookbook/#exec</a><br></div><div><a href="http://upstart.ubuntu.com/cookbook/#script">http://upstart.ubuntu.com/cookbook/#script</a><br>
</div>
<div><a href="http://upstart.ubuntu.com/cookbook/#normal-start" target="_blank">http://upstart.ubuntu.com/cookbook/#normal-start</a></div><div><a href="http://upstart.ubuntu.com/cookbook/#how-to-establish-a-jobs-start-on-and-stop-on-conditions" target="_blank">http://upstart.ubuntu.com/cookbook/#how-to-establish-a-jobs-start-on-and-stop-on-conditions</a><br>
</div><div><br></div><div>The most basic job that might (?) be appropriate for you (assuming you are running Debian or Ubuntu?) is something like this:</div><div><br></div><div>$ cat <<EOT | sudo tee /etc/init/myjob.conf</div>
<div>start on runlevel [2345]</div><div><br></div><div>expect daemon</div><div>exec mydaemon --arg "foo" --arg2 1.234</div><div>EOT</div><div><br></div><div>That 'expect' stanza is exceptionally important so read the following atleast twice:<br>
</div>
<div><br></div><div><a href="http://upstart.ubuntu.com/cookbook/#expect" target="_blank">http://upstart.ubuntu.com/cookbook/#expect</a><br></div><div><br></div><div>init(5) lists all the available stanzas along with giving example usage for most of them. The Cookbook also provides this information.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Thanks for the help.<br>
Chris Warner<br>
<br>
All information contained in this document (and any attachments) is considered proprietary property of THOR·LO, Inc. ©<br>
<span><font color="#888888"><br>
--<br>
upstart-devel mailing list<br>
<a href="mailto:upstart-devel@lists.ubuntu.com" target="_blank">upstart-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/upstart-devel" target="_blank">https://lists.ubuntu.com/mailman/listinfo/upstart-devel</a><br>
</font></span></blockquote></div><div><br></div><div dir="ltr">Kind regards,<br><br>James.<br>--<br>James Hunt<br>____________________________________<br>#upstart on freenode<br><a href="http://upstart.ubuntu.com/cookbook" target="_blank">http://upstart.ubuntu.com/cookbook</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/upstart-devel" target="_blank">https://lists.ubuntu.com/mailman/listinfo/upstart-devel</a><br></div>
</div></div>