Mandriva: when server starts/stops, run scripts

With this feature, server special initialization and/or preparation can
be scripted. The same after stopping, too.

bzr revid: p_christ@hol.gr-20091023222925-oph2bc6kr3u0ol7w
This commit is contained in:
P. Christeas 2009-10-24 01:29:25 +03:00
parent 78ac7ac767
commit c716ecb731
1 changed files with 30 additions and 17 deletions

View File

@ -50,6 +50,14 @@ fi
RETVAL=0
start() {
if [ -d /etc/openerp/start.d ] ; then
echo -n $"Preparing $desc: "
run-parts --exit-on-error /etc/openerp/start.d
RETVAL=$?
echo
[ $RETVAL -ne 0 ] && return $RETVAL
fi
echo -n $"Starting $desc ($prog): "
daemon --user openerp --check openerp-server \
"/usr/bin/setsid /usr/bin/openerp-server \
@ -76,6 +84,11 @@ stop() {
echo_failure
echo
fi
if [ -d /etc/openerp/stop.d ] ; then
echo -n $"Clearing $desc: "
run-parts /etc/openerp/stop.d
echo
fi
return $RETVAL
}