upstart on lucid

Evan Huus eapache at gmail.com
Sun Mar 11 19:01:50 UTC 2012


On Sun, Mar 11, 2012 at 2:33 PM, Till Klampaeckel <till at lagged.biz> wrote:

> Hi,
>
> I was wondering what you guys suggest to debug upstart scripts. In
> general, I am having trouble finding docs which are suitable for
> upstart on lucid. It seems like 0.6.5 is installed and most of the
> time the only error message received is 'unknown job'.
>

When doing what? On boot? When running initctl?

I've been thinking about upgrading but I couldn't find great guides,
> add to that updating a super daemon at instance start up seems like
> asking for more problems. We run all our servers on AWS currently and
> bootstrap the rest of the stack with chef.
>

It depends what you're trying to do. The version of upstart on Lucid has a
few limitations, but unless you're running into one of them (such as no
chroot support) then you shouldn't have to upgrade.

Anyway, I've tried a few things.
>
> E.g., verbose doesn't seem to work at all:
> $ sudo initctl -vvvvvv start gearman-worker
> gearman-worker start/running, process 17992
>
> (Note: the worker is not running. ;))
>

I'm guessing the worker forks once or twice (to daemonize). Try the
'expect' stanza [1].


> I am trying this in my 'script' block:
>
>  exec 2 >> /var/log/upstart-debug.log
>  set -x
>
> But the log stays empty. I don't know what it does in there which
> would yield a 'successful' result.
>

It's possible that that part of the filesystem isn't writable when the job
runs (if this is a job that starts on boot). Try the lines suggested in
[2]. There are other lots of other debugging suggestions in that section
[3] as well, but not all of them will apply to the version in Lucid.

My second problem is:
>
> I wanted to distribute the gearman-worker.conf with the worker code
> and created a symlink from /etc/init/gearman-worker.conf to my
> application checkout - upstart fails with 'unknown job' and strace
> tells me it thinks 'resource not available'.
>

Symbolic links are not permitted in /etc/init/ [4]. If the checkout is on
the same filesystem, use hard links instead.

If you have any more questions, the answer is probably in the cookbook [5].

Hope this helps,
Evan

[1] http://upstart.ubuntu.com/cookbook/#expect
[2] http://upstart.ubuntu.com/cookbook/#obtaining-a-log-of-a-script-section
[3] http://upstart.ubuntu.com/cookbook/#debugging
[4]
http://upstart.ubuntu.com/cookbook/#symbolic-links-don-t-work-in-etc-init
[5] http://upstart.ubuntu.com/cookbook/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20120311/edeebc4e/attachment.html>


More information about the upstart-devel mailing list