Hi Daniel,

2014-07-28 3:01 GMT+01:00 Daniel Lam <daniel.ck...@gmail.com>:

> Hi there,
>
> Need some help in using upstart in an Amazon-Linux-AMI instance here. My
> apology if this is not the right place to ask.. but IRC channel says "post
> to mailing list if no response here".
>
> I've got my .conf below placed in /etc/init. Command to start/stop/restart
> would work, e.g. "sudo start my-app-name". However I can't get my process
> to start automatically on reboot (see how I tried 2 different params
> already).
>
>
>     #!upstart
>
I'm guessing this is just a reminder to yourself that this is an upstart
job since there is no hash-bang magic for upstart :-)


>     description "node app"
>
>
>
>     #start on started mountall
>
>     start on startup
>
This is the most likely cause of the issue you are seeing. Read
http://upstart.ubuntu.com/cookbook/#normal-start (use the runlevel
version). As documented in upstart-events(7) and startup(7), the startup
event is emitted very early in boot - before disks are writeable, etc. Use
'start on runlevel [2345]. If you have particular requirements for starting
as early as possible, I suggest you read upstart-events(7) carefully since
this documents all "well-known" events along with the order in which they
are emitted.


>     stop on shutdown
>
(Unless you have arranged to have this event emitted) this is incorrect -
see http://upstart.ubuntu.com/cookbook/#normal-shutdown.



>
>
>     # Automatically Respawn:
>
>     respawn
>
>     respawn limit 99 5
>
See the extremely important note that starts this section -
http://upstart.ubuntu.com/cookbook/#respawn


>
>     env NODE_ENV=development
>
>
>
>     script
>
>         cd /home/ec2-user/test
>
Best to use the chdir stanza:  http://upstart.ubuntu.com/cookbook/#chdir.
Note that this service will be running as root. Maybe you want to run as
ec2-user instead? See:

http://upstart.ubuntu.com/cookbook/#setuid
http://upstart.ubuntu.com/cookbook/#setgid


        exec node app.js 2>&1 >> /var/log/test.log
>
Redirection most likely not necessary since as of Upstart 1.4, all job
output is logged automatically to /var/log/upstart/$job.log. To determine
which version of Upstart you are using, run "initctl version". This coupled
to the fact you were starting the job 'on startup' likely meant that app.js
was failing to start (due to disks not being writeable), but it also wasn't
able to log any errors for the same reason.

    end script
>
>
> Any help will be much appreciated thank you!
>
> Daniel
>
>
> --
> upstart-devel mailing list
> upstart-devel@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
-- 
upstart-devel mailing list
upstart-devel@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to