From dbf2ef78aff912ecb8db53d3838b1fc194322dcc Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 28 Apr 2015 23:07:36 +0530 Subject: [PATCH] add websocket service files --- etc/init/pandora-websocketd.conf | 26 ++++++++++++++++++++++++++ etc/systemd/pandora-websocketd.service | 18 ++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 etc/init/pandora-websocketd.conf create mode 100644 etc/systemd/pandora-websocketd.service diff --git a/etc/init/pandora-websocketd.conf b/etc/init/pandora-websocketd.conf new file mode 100644 index 00000000..a661bae9 --- /dev/null +++ b/etc/init/pandora-websocketd.conf @@ -0,0 +1,26 @@ +# pandora background tasks daemon +# + +description "pandora background tasks daemon" + +start on runlevel [2345] +stop on runlevel [!2345] + +respawn + +env VENV=/srv/pandora +env USER=pandora +env HOME=/home/pandora +env LANG=en_US.UTF-8 + +pre-start script +test -e /var/log/pandora || (mkdir -p /var/log/pandora && chown $USER:$USER /var/log/pandora) +test -e /var/run/pandora || (mkdir -p /var/run/pandora && chown $USER:$USER /var/run/pandora) +end script + +exec start-stop-daemon \ + --start -c $USER -d $VENV/pandora \ + --pidfile /var/run/pandora/pandora-websocketd.pid \ + --exec $VENV/bin/python -- \ + $VENV/pandora/manage.py websocketd \ + --pidfile /var/run/pandora/pandora-websocketd.pid diff --git a/etc/systemd/pandora-websocketd.service b/etc/systemd/pandora-websocketd.service new file mode 100644 index 00000000..5262810f --- /dev/null +++ b/etc/systemd/pandora-websocketd.service @@ -0,0 +1,18 @@ +[Unit] +Description=pandora websocket daemon + +[Service] +Type=simple +Restart=always +User=pandora +Group=pandora +PIDFile=/run/pandora/websocketd.pid +WorkingDirectory=/srv/pandora/pandora +StandardOutput=syslog +StandardError=syslog +ExecStart=/srv/pandora/bin/python /srv/pandora/pandora/manage.py websocketd \ + --pidfile /run/pandora/websocketd.pid +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target