Upstart Jobs
James Hunt
james.hunt at ubuntu.com
Thu Mar 13 15:53:38 UTC 2014
Hi Chris,
2014-03-13 13:33 GMT+00:00 Chris Warner <cwarner at thorlo.com>:
> 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.
>
> I see .conf files in /etc/init I see links and links to other scripts in
> /etc/init.d.
>
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.
> I have a service I am trying to setup, and when I run service I don't see
> my service listed...
As mentioned, service(8) is not an upstart command. What does "sudo status
myjob" show?
http://upstart.ubuntu.com/cookbook/#initctl-status
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:
http://upstart.ubuntu.com/cookbook/#init-checkconf
> 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'
>
That's because every service is different :) Take a look at the following
though to get your started:
http://upstart.ubuntu.com/cookbook/#exec
http://upstart.ubuntu.com/cookbook/#script
http://upstart.ubuntu.com/cookbook/#normal-start
http://upstart.ubuntu.com/cookbook/#how-to-establish-a-jobs-start-on-and-stop-on-conditions
The most basic job that might (?) be appropriate for you (assuming you are
running Debian or Ubuntu?) is something like this:
$ cat <<EOT | sudo tee /etc/init/myjob.conf
start on runlevel [2345]
expect daemon
exec mydaemon --arg "foo" --arg2 1.234
EOT
That 'expect' stanza is exceptionally important so read the following
atleast twice:
http://upstart.ubuntu.com/cookbook/#expect
init(5) lists all the available stanzas along with giving example usage for
most of them. The Cookbook also provides this information.
> Thanks for the help.
> Chris Warner
>
> All information contained in this document (and any attachments) is
> considered proprietary property of THOR·LO, Inc. ©
>
> --
> upstart-devel mailing list
> upstart-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/upstart-devel
>
Kind regards,
James.
--
James Hunt
____________________________________
#upstart on freenode
http://upstart.ubuntu.com/cookbook
https://lists.ubuntu.com/mailman/listinfo/upstart-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20140313/c31f29e6/attachment.html>
More information about the upstart-devel
mailing list