congrats for joining the club 🙂 I took a sneak peak at what you've got going so far - looking good I have to say
Thank you but its very early days 🙂
I recently moved up to Ubuntu 16.04.1. I see a nice example of Upstart in the documentation, but nothing for a systemd script.
Does anyone have an example script I can use to manage the NodeBB service, have it start at boot, etc?
@teh_g try it
This is what i do when running my docker pkg in systemd with nodebb (app.js)
ExecStart=/usr/bin/docker run --entrypoint su --name nodejs-nimbus-jenkler-com --net local --volumes-from server_nodejs -w /server/nodejs jenkler/nodejs nobody -s /usr/bin/node app.js
ExecStartPre=-/usr/bin/docker kill nodejs-nimbus-jenkler-com
ExecStartPre=-/usr/bin/docker rm nodejs-nimbus-jenkler-com
ExecStop=/usr/bin/docker stop nodejs-nimbus-jenkler-com
I start /usr/bin/node app.js as the nobody user! If somebody else runs nodebb in docker with another take, plz speak up. The app.js way works fine for me except for restarting via the webb ui. I guss i need loader.js for that
If i use loader.js instead of app.js the application wont exit correctly when systemd runs ExecStop. I get some strange exit code and docker get an error. I guess thats because loader is a wrapper for app.js! Correct me if I am wrong!
To answer the question run:
I guess you need to change dir also. I do that with docker -w /server/nodejs jenkler/nodejs.
You pass in
--no-silent because Upstart works best if the program itself is run interactively, with output sent to
However, I don't recall if systemd is different...
If it works best run interactively, use
If it reads output from stdout (which I believe it does), then use