Server IP : 85.214.239.14 / Your IP : 3.12.165.179 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/proc/3/cwd/lib/node_modules/pm2/lib/templates/init-scripts/ |
Upload File : |
#!/bin/bash # # pm2 Process manager for NodeJS # # chkconfig: 345 80 20 # # description: PM2 next gen process manager for Node.js # processname: pm2 # ### BEGIN INIT INFO # Provides: pm2 # Required-Start: $local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # Should-Start: $network # Should-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: PM2 init script # Description: PM2 is the next gen process manager for Node.js ### END INIT INFO NAME=pm2 PM2=%PM2_PATH% USER=%USER% export PATH=%NODE_PATH%:$PATH export PM2_HOME="%HOME_PATH%" lockfile="/var/lock/subsys/pm2-init.sh" super() { su - $USER -c "PATH=$PATH; PM2_HOME=$PM2_HOME $*" } start() { echo "Starting $NAME" super $PM2 resurrect retval=$? [ $retval -eq 0 ] && touch $lockfile } stop() { echo "Stopping $NAME" super $PM2 kill rm -f $lockfile } restart() { echo "Restarting $NAME" stop start } reload() { echo "Reloading $NAME" super $PM2 reload all } status() { echo "Status for $NAME:" super $PM2 list RETVAL=$? } case "$1" in start) start ;; stop) stop ;; status) status ;; restart) restart ;; reload) reload ;; *) echo "Usage: {start|stop|status|restart|reload}" exit 1 ;; esac exit $RETVAL