init,postinst: move collectstatic in the init.d file

also activate the reload action
This commit is contained in:
Benjamin Dauvergne 2014-05-22 16:08:06 +02:00
parent c597b14b34
commit fad50324e6
2 changed files with 15 additions and 12 deletions

View File

@ -116,10 +116,16 @@ do_migrate() {
log_action_msg ".. done"
}
do_collectstatic() {
log_action_msg "Collect static files.."
su $USER -p -c "/usr/bin/portail-citoyen-manage collectstatic --noinput"
log_action_msg ".. done"
}
case "$1" in
start)
do_migrate
do_collectstatic
log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
@ -138,15 +144,15 @@ case "$1" in
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
reload|force-reload)
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
# and leave 'force-reload' as an alias for 'restart'.
log_daemon_msg "Reloading $DESC" "$NAME"
do_reload
log_end_msg $?
;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
@ -155,6 +161,7 @@ case "$1" in
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
do_migrate
do_collectstatic
case "$?" in
0|1)
do_start

View File

@ -63,10 +63,6 @@ case "$1" in
dbc_pgsql_createdb_encoding="UTF8"
dbc_go portail-citoyen $@
fi
echo -n "Generating static files.." >&2
su $USER -p -c "/usr/bin/portail-citoyen-manage collectstatic --noinput" >&2
echo "..done" >&2
;;
reconfigure|abort-upgrade|abort-remove|abort-deconfigure)