Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Startup system (systemd, upstart, launchd, rc.d) #2559

Closed
11 of 12 tasks
Unitech opened this issue Dec 6, 2016 · 6 comments
Closed
11 of 12 tasks

Refactor Startup system (systemd, upstart, launchd, rc.d) #2559

Unitech opened this issue Dec 6, 2016 · 6 comments

Comments

@Unitech
Copy link
Owner

Unitech commented Dec 6, 2016

Refactor the Startup System to support:

  • systemd
  • upstart
  • launchd
  • rc.d

Steps:

  • Full startup commands refactor
  • Auto discover init system in running machine
  • Support windows init system
  • Do not launch PM2 as root when running startup command
  • Allow to remove startup system (pm2 unstartup)
  • Harden Systemd template
  • Multi user support
  • Harden Systemv template (upstart)
  • Print generated file, commands and destination
  • Test system
  • Do not duplicate process on resurrection
  • Allow to attach to external process and auto exit on target PM2 kill

Current work is available in development branch:

$ npm install Unitech/pm2#development -g
$ pm2 update
$ pm2 startup     # Then copy / paste the command displayed
$ pm2 unstartup

Issues related

Systemd

Upstart

Launchd

Windows

General

@Unitech
Copy link
Owner Author

Unitech commented Dec 12, 2016

Published on @next (2.2.0):

$ npm install pm2@next -g
$ pm2 update
# Get line to be executed as root
$ pm2 startup     # Generate startup script
$ pm2 unstartup # Deactivate and remove startup script

@Unitech Unitech closed this as completed Dec 12, 2016
@Unitech
Copy link
Owner Author

Unitech commented Dec 12, 2016

To delete previous startup script (only for upstart) and upgrade to the new one

$ pm2 unstartup upstart
$ pm2 startup upstart

If you have systemd running, use it instead of upstart

@Unitech
Copy link
Owner Author

Unitech commented Dec 14, 2016

2.2.1 Released!

Changelog: https://github.com/Unitech/pm2/releases/tag/2.2.1
Startup documentation: http://pm2.keymetrics.io/docs/usage/startup/

$ npm install pm2 -g

@inl-pd-autotest
Copy link

systemd on CentOS 7, using pm2 startup without details (like systemd or centos).
I need pm2 to be started by root, so that pm2 ls executed by root would list the jobs.
The job needs to be autostarted by an unprivileged user.
This scenario still fails (pm2 2.7.2), nothing is fixed.

@Xaekai
Copy link

Xaekai commented Apr 10, 2020

Having read many many issues, it seems like they have given up on supporting this software in the way most people want to use it: running as root and all managed apps either are started as less privileged users, or drop privs themselves after binding privileged resources.

I guess someone needs to make a hard fork that supports running as root and only as root to gut any possible confusion.

@Unitech
Copy link
Owner Author

Unitech commented Apr 12, 2020

looking to it

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

No branches or pull requests

3 participants