diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-25 03:04:47 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-25 03:08:17 +0200 |
commit | 4d18d701ea486e269c4c8d9d5e642574fc3c8590 (patch) | |
tree | 14bb01381f91914f8ec82ce5350102d8745a44a3 /main/uwsgi/uwsgi.initd | |
parent | 87bb7845b1e1482d6bfc5cf0954ef0dd46158d20 (diff) | |
download | aports-4d18d701ea486e269c4c8d9d5e642574fc3c8590.tar.bz2 aports-4d18d701ea486e269c4c8d9d5e642574fc3c8590.tar.xz |
main/uwsgi: remove parsing of uwsgi_* vars from runscript
Uwsgi options are unfortunately order-dependent, but `set` returns
variables in unspecified order. This causes more troubles than good,
so I've replaced it with single uwsgi_opts variable.
Diffstat (limited to 'main/uwsgi/uwsgi.initd')
-rw-r--r-- | main/uwsgi/uwsgi.initd | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/main/uwsgi/uwsgi.initd b/main/uwsgi/uwsgi.initd index 8502ebba1a..cdef9f0492 100644 --- a/main/uwsgi/uwsgi.initd +++ b/main/uwsgi/uwsgi.initd @@ -2,8 +2,8 @@ # If you want to run multiple separate processes, then create symlinks to # this runscript (e.g. uwsgi.myapp or myapp) and configure options in -# the corresponding conf.d files. uWSGI options can be specified as variables -# prefixed with "uwsgi_" (e.g. uwsgi_chmod_socket=640 -> --chmod-socket=640). +# the corresponding conf.d files. uWSGI options can be specified using +# variable uwsgi_opts or config file specified by variable uwsgi_conf. : ${pidfile:="/run/$RC_SVCNAME/uwsgi.pid"} @@ -12,7 +12,7 @@ description_reload='Gracefully reload all the workers and the master process' description_stats='Dump uWSGI statistics to log file' command='/usr/sbin/uwsgi' -command_args="--die-on-term" +command_args="--die-on-term ${uwsgi_opts:-}" command_background='yes' start_stop_daemon_args='--quiet' retry='INT/30/KILL/5' @@ -37,7 +37,7 @@ start_pre() { : ${user:="root"} else : ${user:="nobody"} - command_args="$command_args --master" + command_args="--master $command_args" fi start_stop_daemon_args="$start_stop_daemon_args --user $user @@ -59,12 +59,6 @@ start_pre() { command_args="$command_args --yaml ${uwsgi_conf%.yml}.yml" fi - # Convert variables "uwsgi_<opt_name>=<value>" into "--<opt-name>=<value>". - local uwsgi_opts="$(set | grep -v '^uwsgi_conf=' \ - | sed -En 's/^uwsgi_([^=]+)=(.*)/--\1=\2 /p' \ - | sed -E ':s; s/^([^=]*)_([^=]*)=(.*)$/\1-\2=\3/; t s;')" - command_args="$command_args $uwsgi_opts" - checkpath -d -m 755 -o $user:$group \ "$(dirname "$pidfile")" "$(dirname "$logfile")" |