aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-12-09 20:41:48 -0500
committerB Stack <bgstack15@gmail.com>2020-12-09 20:41:48 -0500
commit4bb2b214f0967796293bb6b563f4fe557863eeff (patch)
tree9da66b5e45f581281ee9953c486950d37430851a /config
parentuse uwsgi! (diff)
downloadhex-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')
-rw-r--r--config/hex-zero.conf.example3
-rwxr-xr-xconfig/hex-zero.init6
2 files changed, 5 insertions, 4 deletions
diff --git a/config/hex-zero.conf.example b/config/hex-zero.conf.example
index 2e7ffa0..71d93e3 100644
--- a/config/hex-zero.conf.example
+++ b/config/hex-zero.conf.example
@@ -55,6 +55,7 @@ WSGI_LOGGING = {
'stream': 'ext://flask.logging.wsgi_errors_stream',
'formatter': 'default'
},
+ # file handler is only useful when running in debug mode. The shell script actually calls the uwsgi server with the right attributes to log to a file.
'file': {
'class': 'logging.handlers.RotatingFileHandler',
'formatter': 'default',
@@ -65,6 +66,6 @@ WSGI_LOGGING = {
},
'root': {
'level': 'INFO',
- 'handlers': ['file']
+ 'handlers': ['file','wsgi']
},
}
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
bgstack15