How to run as daemon? #83

Closed
viniciusbo opened this Issue Nov 1, 2016 · 10 comments

Comments

Projects
None yet
4 participants

viniciusbo commented Nov 1, 2016

I've tried to use https://github.com/terminalcloud/terminal-tools/blob/master/daemonize.sh script but this message is getting me stuck: Failed to start verdaccio.service: Unit verdaccio.service failed to load: No such file or directory.. I'm going to try daemonize (I mean this one http://software.clapper.org/daemonize/) as well.

So I was wondering how you guys daemonize Verdaccio process.

The best solution I found so far is to daemonize it using PM2.

pm2 start /usr/local/lib/node_modules/verdaccio/bin/verdaccio -- -l host:port
Contributor

jachstet-sea commented Nov 2, 2016

I prefer "screen" for that purpose. It allows you to interactively start commands, then detach, logout and re-attach to that shell later if needed.

Contributor

030 commented Nov 3, 2016

What about a systemd script?

@030 nice!

Contributor

030 commented Nov 3, 2016

What about deploying this file as /etc/systemd/system/verdaccio.service when npm install -g verdaccio is run so it is possible to start it as a service?

Contributor

jachstet-sea commented Nov 3, 2016

I oppose automatically creating a file below the /etc directory for one reason: Software installed using package managers (and I see npm as one) should be cleanly and completely removed when uninstalled using that package manager. If a file is copied to /etc using a hook (or did you think of another way?), you also need a hook that removes that file again when uninstalling.

@jachstet-sea made a good point.

I think it should be optional also because people may prefer other daemon solutions. Altough most server's OSs use systemd by default, personally I prefer OpenRC (at my local machine).

Contributor

030 commented Nov 3, 2016

We could deploy it using ansible for example

@juanpicado juanpicado added the question label Feb 4, 2017

@juanpicado juanpicado added this to the 2.1.2 milestone Feb 9, 2017

Owner

juanpicado commented Feb 9, 2017

I think I can close this one, systemd patch has been already merged and pm2 is also a good solution.

@juanpicado juanpicado closed this Feb 9, 2017

juanpicado added a commit that referenced this issue Mar 10, 2017

@juanpicado juanpicado added scale and removed scale labels Apr 14, 2017

Owner

juanpicado commented Jul 7, 2017

fixed on #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment