From 4bb2b214f0967796293bb6b563f4fe557863eeff Mon Sep 17 00:00:00 2001 From: B Stack Date: Wed, 9 Dec 2020 20:41:48 -0500 Subject: 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 --- config/hex-zero.init | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/hex-zero.init') 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 -- cgit