2015-10-15 12:47:10 +00:00
|
|
|
#!/bin/sh
|
2018-09-10 09:27:05 +00:00
|
|
|
|
2015-10-15 12:47:10 +00:00
|
|
|
# `/sbin/setuser www-data` runs the given command as the user `www-data`.
|
2020-09-25 10:26:17 +00:00
|
|
|
RUNAS=$(which setuser)
|
|
|
|
[ -z "$RUNAS" ] && RUNAS="$(which sudo) -u"
|
2018-09-10 09:27:05 +00:00
|
|
|
USER=www-data
|
|
|
|
|
|
|
|
DJANGO_PROJECT=/srv/webvirtcloud
|
2020-04-17 11:02:18 +00:00
|
|
|
PYTHON=$DJANGO_PROJECT/venv/bin/python3
|
2018-09-10 09:27:05 +00:00
|
|
|
NOVNCD=$DJANGO_PROJECT/console/novncd
|
|
|
|
|
|
|
|
# make novncd debug, verbose
|
|
|
|
#PARAMS="-d -v"
|
|
|
|
|
|
|
|
LOG=/var/log/novncd.log
|
|
|
|
|
2020-09-25 10:26:17 +00:00
|
|
|
cd $DJANGO_PROJECT || exit
|
|
|
|
exec "$RUNAS" "$USER" "$PYTHON" "$NOVNCD" "$PARAMS" >> $LOG 2>&1
|