Disclaimer: The following could be considered rude and very ugly
This is the only thing I am unable to get around and I'm not sure how to get around it.
If ZM is running when the package is upgraded, it will not stop
You have to stop ZM before updating ( and I forced this in the spec so no one gets nailed) but the correct way to do this is using condrestart so that if ZM was running before the update, it would start back up after and apply the conf and DB updates (like in the case of yum update running nightly).
Is there anything you are aware of I can do in order to force stop the old process and be able to get status?
When I execute a condrestart by hand (This was done in the upgrade process)
Code: Select all
start() {
loadconf || return $?
checkdb || return $?
/usr/local/sbin/motd.sh > /etc/motd
echo -n "Starting $prog: "
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo_success
[ $RETVAL != 0 ] && echo_failure
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/zm
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo_success
[ $RETVAL != 0 ] && echo_failure
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
}
case "$1" in
SNIP
'condrestart')
result=`$command status`
if [ "$result" = "running" ]; then
stop
start
fi
;;
Code: Select all
# service zm condrestart
Undefined subroutine &ZoneMinder::Config::ZM_DB_HOST called at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/Config.pm line 88.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder/Config.pm line 99.
Compilation failed in require at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.5/ZoneMinder.pm line 33.
Compilation failed in require at /usr/lib/zm/bin/zmpkg.pl line 45.
BEGIN failed--compilation aborted at /usr/lib/zm/bin/zmpkg.pl line 45.
I have also seperated out the update function to checkcfg and checkdb and make changes to the zm start script so I can update the zm.conf without updating the database like so:
Code: Select all
'condrestart')
loadconf
checkcfg
result=`$command status`
if [ "$result" = "running" ]; then
stop
checkdb
start
fi
;;
Code: Select all
Stopping ZoneMinder: Bareword "ZM_RUN_AUDIT" not allowed while "strict subs" in use at /usr/lib/zm/bin/zmpkg.pl line 206.
Execution of /usr/lib/zm/bin/zmpkg.pl aborted due to compilation errors.
# service zm status
Bareword "ZM_RUN_AUDIT" not allowed while "strict subs" in use at /usr/lib/zm/bin/zmpkg.pl line 206.
Execution of /usr/lib/zm/bin/zmpkg.pl aborted due to compilation errors.
ZoneMinder is stopped
From Top
9932 apache 16 0 7412 5648 2180 S 0.0 1.1 0:00.00 zmdc.pl
This is as close as I can get.
I'm stumped and look forward to any assistance from anyone.
AKA: HELP
Corey