diff options
author | B Stack <bgstack15@gmail.com> | 2020-12-09 20:41:48 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-12-09 20:41:48 -0500 |
commit | 4bb2b214f0967796293bb6b563f4fe557863eeff (patch) | |
tree | 9da66b5e45f581281ee9953c486950d37430851a /config/hex-zero.init | |
parent | use uwsgi! (diff) | |
download | hex-zero-4bb2b214f0967796293bb6b563f4fe557863eeff.tar.gz hex-zero-4bb2b214f0967796293bb6b563f4fe557863eeff.tar.bz2 hex-zero-4bb2b214f0967796293bb6b563f4fe557863eeff.zip |
fix init script and pidfile ownership
By running everything as root and telling uwsgi to run as a user,
we can accomplish everything we need with pidfile ownership,
service execution, and hex-zero operation
Diffstat (limited to 'config/hex-zero.init')
-rwxr-xr-x | config/hex-zero.init | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/config/hex-zero.init b/config/hex-zero.init index 17bac95..18dbf60 100755 --- a/config/hex-zero.init +++ b/config/hex-zero.init @@ -19,7 +19,7 @@ DESC="hex-zero" NAME=hex-zero DAEMON=/var/www/0x0/hex-zero.wsgi DAEMON_ARGS="" -PIDFILE=/tmp/$NAME.pid +PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME USER=hex-zero @@ -54,10 +54,10 @@ do_start() #su $USER -c "$DAEMON" & # The above code will not work for interpreted scripts, use the next # six lines below instead (Ref: #643337, start-stop-daemon(8) ) - start-stop-daemon --start --chuid $USER --pidfile $PIDFILE --startas $DAEMON \ + start-stop-daemon --start --pidfile $PIDFILE --startas $DAEMON \ --name uwsgi_python3 --test > /dev/null \ || return 1 - start-stop-daemon --start --chuid $USER --background --pidfile $PIDFILE --startas $DAEMON \ + start-stop-daemon --start --background --pidfile $PIDFILE --startas $DAEMON \ --name uwsgi_python3 -- $DAEMON_ARGS \ || return 2 |