0.0.48 • Published 1 year ago

pm2sd v0.0.48

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

pm2sd

PM2SD is a process manager for Node.js applications (or other scripts) built over system services. It is inspired by PM2, but not that complex and uses far less memory (i.e. zero memory as it is wrapper for systemd service at Linux, for instance). I love PM2, but cannot use it on small VPS for pet projects, so meet the PM2SD!

You can start process as simple as

$ pm2sd start index.js

Process will be started as system service (i.e. added to /etc/systemd/system at Linux), enabled for restart after reboot, will restart in 30 seconds if it crashes, output and error logs goes to /var/log/pm2sd-<name> (if you want configure and start service under non-privileged user, you need to do some magic).

No clusters, no load balancers, no watching, just one living process.

It works on Linux, and Windows is in the plans :construction: :hammer:.

Commands

Implemented commands: ls, start, stop, restart, delete, log.

ls

Lists all pm2sd services. Also, you can get list of all system services with option --all:

$ pm2sd ls --all

You can filter list of all services by part of its name with pm2sd ls <name>.

Also you can use --json option to get json instead of colored text output.

start

Starts new process. Avaliable options: name, description, time, user (i.e. service can be started from any user). --time adds timestamp to logs.

$ pm2sd start index.js --name=test --user=node --time

stop

Stops process (by its name).

restart

Restarts process (by its name).

delete

Delete all traces of process (include logs).

log

Tails log of selected process (pm2sd log <name>) or logs for all processes if nothing specified (pm2sd log).

Troubleshooting

  1. If you've got Failed to connect to D-Bus that means you're trying to work under non-root user, which requires the systemd user service to be started (look at this).

  2. If service does not start at boot for non-root user, please check if user lingering is enabled (look at this).

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.47

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.29

1 year ago

0.0.48

1 year ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago