Projet

Général

Profil

« Précédent | Suivant » 

Révision e9eec4a1

Ajouté par Frédéric Péters il y a plus de 6 ans

debian: adapt to wcs packaging changes (#17976)

Voir les différences:

debian/50auquotidien.py
1
WCS_LEGACY_CONFIG_FILE = '/etc/wcs/wcs-au-quotidien.cfg'
2
INSTALLED_APPS = INSTALLED_APPS + ('auquotidien',)
debian/postinst
3 3
set -e
4 4

  
5 5
NAME=wcs-auquotidien
6
DAEMON=/usr/sbin/wcsctl
7 6
WCS_USER=wcs-au-quotidien
8 7
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
9 8

  
......
13 12
	. /etc/default/$NAME
14 13
fi
15 14

  
16
if [ $CONFIG_FILE ]; then
17
    COMMAND="$DAEMON -f $CONFIG_FILE"
18
else
19
    COMMAND="$DAEMON"
20
fi
21

  
22 15
case "$1" in
23 16
  configure)
24 17
    if ! getent passwd wcs-au-quotidien >/dev/null; then
......
28 21
      chown wcs-au-quotidien: /var/lib/wcs-au-quotidien
29 22
    fi
30 23
  ;;
31
  triggered)
32
    su -s /bin/sh -c "$COMMAND hobo_deploy --redeploy" $WCS_USER
33
    exit 0
34
  ;;
35 24
  abort-upgrade|abort-remove|abort-deconfigure)
36 25
  ;;
37 26
  *)
debian/triggers
1
interest-noawait hobo-redeploy
debian/wcs
1
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
2
USER=wcs-au-quotidien
3
GROUP=wcs-au-quotidien
debian/wcs-au-quotidien.init
7 7
# Should-Stop:       postgresql
8 8
# Default-Start:     2 3 4 5
9 9
# Default-Stop:      0 1 6
10
# Short-Description: w.c.s. (Au quotidien)
10
# Short-Description: w.c.s. (Au quotidien) (dummy)
11 11
# Description:       w.c.s. Form Server (with Au Quotidien Extension)
12 12
### END INIT INFO
13 13

  
14
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15
DESC="w.c.s. (+Au Quotidien)"
16
NAME=wcs-auquotidien
17
DAEMON=/usr/sbin/wcsctl
18
PIDFILE=/var/run/$NAME.pid
19
SCRIPTNAME=/etc/init.d/$NAME
20
PYTHON_VERSION=`/usr/bin/env python -c \
21
    "import sys; print '%d.%d' % (sys.version_info[0], sys.version_info[1])"`
22
OPTIONS="--extra /usr/lib/pymodules/python$PYTHON_VERSION/auquotidien/"
23
WCS_USER=wcs-au-quotidien
24
WCS_GROUP=wcs-au-quotidien
25
CONFIG_FILE=/etc/wcs/wcs-au-quotidien.cfg
26

  
27
# Gracefully exit if the package has been removed.
28
test -x $DAEMON || exit 0
29

  
30
# Read config file if it is present.
31
if [ -r /etc/default/$NAME ]
32
then
33
	. /etc/default/$NAME
34
fi
35

  
36
#
37
#	Function that starts the daemon/service.
38
#
39
d_start() {
40
	if [ $CONFIG_FILE ]; then
41
		$DAEMON -f $CONFIG_FILE collectstatic $OPTIONS
42
		start-stop-daemon --start --quiet --pidfile $PIDFILE \
43
			--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
44
			--exec $DAEMON -- -f $CONFIG_FILE start $OPTIONS
45
	else
46
		$DAEMON collectstatic $OPTIONS
47
		start-stop-daemon --start --quiet --pidfile $PIDFILE \
48
			--chuid $WCS_USER:$WCS_GROUP --make-pidfile --background \
49
			--exec $DAEMON -- start $OPTIONS
50
	fi
51
}
52

  
53
#
54
#	Function that stops the daemon/service.
55
#
56
d_stop() {
57
	start-stop-daemon --stop --quiet --pidfile $PIDFILE
58
}
59

  
60
#
61
#	Function that sends a SIGHUP to the daemon/service.
62
#
63
d_reload() {
64
	start-stop-daemon --stop --quiet --pidfile $PIDFILE \
65
		--make-pidfile --background --signal 1
66
}
67

  
68
case "$1" in
69
  start)
70
	echo -n "Starting $DESC: $NAME"
71
	d_start
72
	echo "."
73
	;;
74
  stop)
75
	echo -n "Stopping $DESC: $NAME"
76
	d_stop
77
	echo "."
78
	;;
79
  #reload)
80
	#
81
	#	If the daemon can reload its configuration without
82
	#	restarting (for example, when it is sent a SIGHUP),
83
	#	then implement that here.
84
	#
85
	#	If the daemon responds to changes in its config file
86
	#	directly anyway, make this an "exit 0".
87
	#
88
	# echo -n "Reloading $DESC configuration..."
89
	# d_reload
90
	# echo "done."
91
  #;;
92
  restart|force-reload)
93
	#
94
	#	If the "reload" option is implemented, move the "force-reload"
95
	#	option to the "reload" entry above. If not, "force-reload" is
96
	#	just the same as "restart".
97
	#
98
	echo -n "Restarting $DESC: $NAME"
99
	d_stop
100
	sleep 1
101
	d_start
102
	echo "."
103
	;;
104
  *)
105
	# echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
106
	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
107
	exit 1
108
	;;
109
esac
110

  
14
# this is now totally handled by wcs itself
111 15
exit 0
debian/wcs-au-quotidien.install
1
debian/wcs /etc/default/
2
debian/50auquotidien.py /etc/wcs/settings.d/

Formats disponibles : Unified diff