Operating System - HP-UX
1825709 Members
3249 Online
109686 Solutions
New Discussion

Re: AT jobs in Serviceguard packages

 
SOLVED
Go to solution
Unixbeheer2
Occasional Contributor

AT jobs in Serviceguard packages

Dear All,

How can i move AT jobs from one host to an other when moving a serviceguard package ?
Is it a question of just moving the files from the dir /var/spool/cron/atjobs to the new host and sending a sughub to the crondaemon or is there more to it . . . ??

Thanks in advance,

Klaas Eenkhoorn
5 REPLIES 5
John Waller
Esteemed Contributor

Re: AT jobs in Serviceguard packages

Klaas,
You need to think about a real failover. Your system will not have time to move over the /var/spool/cron/atjobs. I believe the best way would be to build the resillience into your package startup scripts. Without more details I don't know if you could do this but I would not rely on the original host being available to move the jobs from.
John Waller
Esteemed Contributor

Re: AT jobs in Serviceguard packages

Klaas,
I've just read your previous post on your problem. The bottom line is yes, I believe you could copy the files from /var/spool/cron/atjobs to your alternate node and issue a kill -1 on the cron PID, but I would still look at a better way to control in the event of a true failover.
Fragon
Trusted Contributor
Solution

Re: AT jobs in Serviceguard packages

I'm not sure this will work:
1. Move the files from the dir /var/spool/cron/atjobs to another host;
2. On another hosta, restart cron daemon!

If the God are smiling, you can add scripts(usually rcp & "/sbin/init.d/cron stop/start") to the MC start-up script, this should be work fine!

Good luck!
-ux

John Waller
Esteemed Contributor

Re: AT jobs in Serviceguard packages

Just been testing and yes you will need to do more than a kill -1 on the cron PID on the alternate node. A /sbin/init.d/cron stop and start is needed but it does work.
Martin Christov
Advisor

Re: AT jobs in Serviceguard packages

Hi Klaas,

1. Way for nodes with more than one package: crontab-entry proves if the MCSG-Package omni41 is running on the local node:

HO=`hostname`
day=`date '+%a'`
if [ `/usr/sbin/cmviewcl|grep omni41|grep running|grep $HO|wc -l` -ne 0 ]
then
# insert your commands in the following lines
:
else
# the package omni41 is not running on this node
exit 0
fi

2. Way: if you are using only one package, you can prepare package-dependent crontabs and start/stop them inside the package-control-file

db001de9:/ root$ls -ltra|grep cron
-rw-r--r-- 1 root sys 3519 Jul 11 2002 .cronroot
-rw-r--r-- 1 root sys 3519 Jul 20 2002 .cronroot.20020720
-rw-r--r-- 1 root sys 728 Feb 28 20:39 .cronroot.mini
-rw-r--r-- 1 root sys 4498 Mar 29 15:46 .cronroot.DE9
-rw-r--r-- 1 root sys 4548 Apr 24 06:29 .cronroot.de9


db001de9:/etc/cmcluster/DE9 root$grep cron *cntl|grep -v log
sapdbci.cntl: start_crontab
sapdbci.cntl: stop_crontab

db001de9:/etc/cmcluster root$grep start_crontab customer.functions
function start_crontab
db001de9:/etc/cmcluster root$grep stop_crontab customer.functions
function stop_crontab

...
function start_crontab
{
/usr/bin/crontab /.cronroot.DE9
echo "(customer.functions): Enabled Crontab for DE9"
}
function stop_crontab
{
/usr/bin/crontab -r
/usr/bin/crontab /.cronroot.mini
echo "(customer.functions): Disabled Crontab for DE9 enabled minimal crontab"
}
...
sudo question