mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 04:06:47 +00:00
build: systemd runs the panel on hosts instead of supervisor
The installer and the manual installation install four systemd units (webvirt-cloud, webvirt-novncd, webvirt-socketiod, webvirt-worker) that run as the web server's user with absolute paths and read /etc/default/webvirtcloud. gunicorn, socketiod and the worker stop with KillMode=mixed, so they wind down their own children. supervisor, its installer code and the contributed systemd files go; the README gets the update, rollback and a one-time move from supervisor, and the installer refuses to run over a supervisor install. Docker keeps runit; novncd's runit script is the one-line form of the others.
This commit is contained in:
parent
fbef55fe2d
commit
837c5468ec
13 changed files with 129 additions and 343 deletions
|
|
@ -1,28 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
USER="www-data"
|
||||
DJANGO_PROJECT="/srv/webvirtcloud"
|
||||
PYTHON="$DJANGO_PROJECT/venv/bin/python3"
|
||||
NOVNCD="$DJANGO_PROJECT/console/novncd"
|
||||
LOG="/var/log/novncd.log"
|
||||
|
||||
cd "$DJANGO_PROJECT" || exit 1
|
||||
|
||||
# make novncd debug, verbose
|
||||
#PARAMS="-d -v"
|
||||
|
||||
if [ -x /sbin/setuser ]; then
|
||||
if [ -n "$PARAMS" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
exec /sbin/setuser "$USER" "$PYTHON" "$NOVNCD" $PARAMS >> "$LOG" 2>&1
|
||||
else
|
||||
exec /sbin/setuser "$USER" "$PYTHON" "$NOVNCD" >> "$LOG" 2>&1
|
||||
fi
|
||||
elif command -v su >/dev/null 2>&1; then
|
||||
if [ -n "$PARAMS" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
exec su -s /bin/sh "$USER" -c "exec \"$PYTHON\" \"$NOVNCD\" $PARAMS" >> "$LOG" 2>&1
|
||||
else
|
||||
exec su -s /bin/sh "$USER" -c "exec \"$PYTHON\" \"$NOVNCD\"" >> "$LOG" 2>&1
|
||||
fi
|
||||
fi
|
||||
cd /srv/webvirtcloud || exit 1
|
||||
exec /sbin/setuser www-data /srv/webvirtcloud/venv/bin/python3 /srv/webvirtcloud/console/novncd >> /var/log/novncd.log 2>&1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue