debian: adapt to wcs packaging changes (#17976)
This commit is contained in:
parent
35a93ec287
commit
e9eec4a14b
|
@ -0,0 +1,2 @@
|
|||
WCS_LEGACY_CONFIG_FILE = '/etc/wcs/wcs-au-quotidien.cfg'
|
||||
INSTALLED_APPS = INSTALLED_APPS + ('auquotidien',)
|
|
@ -3,7 +3,6 @@
|
|||
set -e
|
||||
|
||||
NAME=wcs-auquotidien
|
||||
DAEMON=/usr/sbin/wcsctl
|
||||
WCS_USER=wcs-au-quotidien
|
||||
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
|
||||
|
||||
|
@ -13,12 +12,6 @@ then
|
|||
. /etc/default/$NAME
|
||||
fi
|
||||
|
||||
if [ $CONFIG_FILE ]; then
|
||||
COMMAND="$DAEMON -f $CONFIG_FILE"
|
||||
else
|
||||
COMMAND="$DAEMON"
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if ! getent passwd wcs-au-quotidien >/dev/null; then
|
||||
|
@ -28,10 +21,6 @@ case "$1" in
|
|||
chown wcs-au-quotidien: /var/lib/wcs-au-quotidien
|
||||
fi
|
||||
;;
|
||||
triggered)
|
||||
su -s /bin/sh -c "$COMMAND hobo_deploy --redeploy" $WCS_USER
|
||||
exit 0
|
||||
;;
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
interest-noawait hobo-redeploy
|
|
@ -0,0 +1,3 @@
|
|||
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
|
||||
USER=wcs-au-quotidien
|
||||
GROUP=wcs-au-quotidien
|
|
@ -7,105 +7,9 @@
|
|||
# Should-Stop: postgresql
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: w.c.s. (Au quotidien)
|
||||
# Short-Description: w.c.s. (Au quotidien) (dummy)
|
||||
# Description: w.c.s. Form Server (with Au Quotidien Extension)
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="w.c.s. (+Au Quotidien)"
|
||||
NAME=wcs-auquotidien
|
||||
DAEMON=/usr/sbin/wcsctl
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
PYTHON_VERSION=`/usr/bin/env python -c \
|
||||
"import sys; print '%d.%d' % (sys.version_info[0], sys.version_info[1])"`
|
||||
OPTIONS="--extra /usr/lib/pymodules/python$PYTHON_VERSION/auquotidien/"
|
||||
WCS_USER=wcs-au-quotidien
|
||||
WCS_GROUP=wcs-au-quotidien
|
||||
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
# Read config file if it is present.
|
||||
if [ -r /etc/default/$NAME ]
|
||||
then
|
||||
. /etc/default/$NAME
|
||||
fi
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service.
|
||||
#
|
||||
d_start() {
|
||||
if [ $CONFIG_FILE ]; then
|
||||
$DAEMON -f $CONFIG_FILE collectstatic $OPTIONS
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
||||
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
|
||||
--exec $DAEMON -- -f $CONFIG_FILE start $OPTIONS
|
||||
else
|
||||
$DAEMON collectstatic $OPTIONS
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
||||
--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
|
||||
--exec $DAEMON -- start $OPTIONS
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service.
|
||||
#
|
||||
d_stop() {
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service.
|
||||
#
|
||||
d_reload() {
|
||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
|
||||
--make-pidfile --background --signal 1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $DESC: $NAME"
|
||||
d_start
|
||||
echo "."
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $DESC: $NAME"
|
||||
d_stop
|
||||
echo "."
|
||||
;;
|
||||
#reload)
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
# If the daemon responds to changes in its config file
|
||||
# directly anyway, make this an "exit 0".
|
||||
#
|
||||
# echo -n "Reloading $DESC configuration..."
|
||||
# d_reload
|
||||
# echo "done."
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented, move the "force-reload"
|
||||
# option to the "reload" entry above. If not, "force-reload" is
|
||||
# just the same as "restart".
|
||||
#
|
||||
echo -n "Restarting $DESC: $NAME"
|
||||
d_stop
|
||||
sleep 1
|
||||
d_start
|
||||
echo "."
|
||||
;;
|
||||
*)
|
||||
# echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# this is now totally handled by wcs itself
|
||||
exit 0
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
debian/wcs /etc/default/
|
||||
debian/50auquotidien.py /etc/wcs/settings.d/
|
Reference in New Issue