summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-10-22 09:56:33 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-10-22 09:56:33 -0400
commit72780d31ec566cbd62df57a6ba4d8fc7bc90bf56 (patch)
tree6f07bf6a25cb8a5df26e8b9e524bddcae8f2d740
parent1ff7d1a6fa1690a352cafc517f6699d2897584f0 (diff)
improve libre/parabolaweb-utils
filesystem: * parabolaweb{-fcgi,-update,.conf}: make the installation directory configurable * parabolaweb.{rc,service}: take care of file-permissions with the pidfile
-rw-r--r--libre/parabolaweb-utils/parabolaweb-fcgi4
-rw-r--r--libre/parabolaweb-utils/parabolaweb-update7
-rw-r--r--libre/parabolaweb-utils/parabolaweb.conf1
-rw-r--r--libre/parabolaweb-utils/parabolaweb.rc1
-rw-r--r--libre/parabolaweb-utils/parabolaweb.service3
5 files changed, 11 insertions, 5 deletions
diff --git a/libre/parabolaweb-utils/parabolaweb-fcgi b/libre/parabolaweb-utils/parabolaweb-fcgi
index 3dec02e10..e42aec3cd 100644
--- a/libre/parabolaweb-utils/parabolaweb-fcgi
+++ b/libre/parabolaweb-utils/parabolaweb-fcgi
@@ -3,9 +3,9 @@ set -e
. /etc/conf.d/parabolaweb
-[[ -e /srv/http/web/manage.py ]]
+[[ -e ${WEBDIR}/manage.py ]]
-sudo -u "${WEBUSER:-$USER}" python2 /srv/http/web/manage.py runfcgi \
+sudo -u "${WEBUSER:-$USER}" python2 "${WEBDIR}/manage.py" runfcgi \
host=${HOST} \
port=${PORT} \
--settings=settings \
diff --git a/libre/parabolaweb-utils/parabolaweb-update b/libre/parabolaweb-utils/parabolaweb-update
index e4d65c2d9..b8ac5bf5e 100644
--- a/libre/parabolaweb-utils/parabolaweb-update
+++ b/libre/parabolaweb-utils/parabolaweb-update
@@ -1,8 +1,11 @@
#!/bin/bash
set -e
-_install_dir=/srv/http
-_gitname=web
+. /etc/conf.d/parabolaweb
+
+
+_install_dir=${WEBDIR%/*}
+_gitname=${WEBDIR##*/}
_gitroot=git://parabolagnulinux.org/parabolaweb.git
_gitbranch=master
diff --git a/libre/parabolaweb-utils/parabolaweb.conf b/libre/parabolaweb-utils/parabolaweb.conf
index c53b19cb8..467e62e2c 100644
--- a/libre/parabolaweb-utils/parabolaweb.conf
+++ b/libre/parabolaweb-utils/parabolaweb.conf
@@ -1,3 +1,4 @@
HOST=127.0.0.1
PORT=8090 # 80 is nginx
+WEBDIR=/srv/http/web
WEBUSER=nobody
diff --git a/libre/parabolaweb-utils/parabolaweb.rc b/libre/parabolaweb-utils/parabolaweb.rc
index 087a3fcb0..5e310b01d 100644
--- a/libre/parabolaweb-utils/parabolaweb.rc
+++ b/libre/parabolaweb-utils/parabolaweb.rc
@@ -8,6 +8,7 @@ PIDFILE=/run/web/parabolaweb.pid
case $1 in
start)
stat_busy "Starting ParabolaWeb"
+ install -dm777 ${PIDFILE%/*}
if parabolaweb-fcgi pidfile=${PIDFILE}; then
add_daemon parabolaweb
stat_done
diff --git a/libre/parabolaweb-utils/parabolaweb.service b/libre/parabolaweb-utils/parabolaweb.service
index 4c3fb8c7f..a59d58512 100644
--- a/libre/parabolaweb-utils/parabolaweb.service
+++ b/libre/parabolaweb-utils/parabolaweb.service
@@ -5,8 +5,9 @@ Description=ParabolaWeb
[Service]
Type=forking
-ExecStart=/usr/sbin/parabolaweb-fcgi pidfile=/run/web/parabolaweb.pid
PIDFile=/run/web/parabolaweb.pid
+ExecStartPre=/usr/bin/install -dm777 /run/web
+ExecStart=/usr/sbin/parabolaweb-fcgi pidfile=/run/web/parabolaweb.pid
[Install]
WantedBy=multi-user.target