[Pacemaker] "crm status" cmd not running through cron job

Arturo Borrero Gonzalez cer.inet at linuxmail.org
Sun Oct 30 10:47:48 EDT 2011


May I suggest a permission problem?

In order to cron to execute something automatically, the script need +x I
think.





> Looks like a environment-(path)-problem. Can you set the same paths in
> the script as you have as user "root"?
> Do this with "export PATH=$PATH:/usr/sbin....."
> Regards,
> Tom
> 2011/10/28 ihjaz Mohamed <ihjazmohamed at yahoo.co.in<http://oss.clusterlabs.org/mailman/listinfo/pacemaker>
> >:
> >* Hi All,
> *>* Am facing a strange issue. When I schedule a script to be run via
> cron, the
> *>* 'crm status' command in the script doesn't get executed. Every other
> *>* commands are executed properly.
> *>* Here's a test script I wrote to test this issue.
> *>
> >* [root at BLRACE70<http://oss.clusterlabs.org/mailman/listinfo/pacemaker>~]# cat test.sh
> *>* #!/bin/sh
> *>
> >* /usr/sbin/crm status >> /var/log/cron_log.log
> *>* echo "Returned:$?" >> /var/log/cron_log.log
> *>
> >* If I run the above file manually. I get output as below in the log:
> *>* ============
> *>* Last updated: Fri Oct 28 17:14:07 2011
> *>* Stack: openais
> *>* Current DC: aceblr073.com - partition with quorum
> *>* Version: 1.1.5-5.el6-01e86afaaa6d4a8c4836f68df80ababd6ca3902f
> *>* 2 Nodes configured, 1 expected votes
> *>* 2 Resources configured.
> *>* ============
> *>
> >* Online: [ aceblr073.com BLRACE70 ]
> *>
> >*  Resource Group: HAService
> *>*      FloatingIP (ocf::heartbeat:IPaddr2):       Started aceblr073.com
> *>*      acestatus  (lsb:acestatus):        Started aceblr073.com
> *>*  Clone Set: pingdclone [pingd]
> *>*      Started: [ aceblr073.com BLRACE70 ]
> *>* Returned:0
> *>
> >* If I schedule it through cron as below:
> *>
> >* [root at BLRACE70<http://oss.clusterlabs.org/mailman/listinfo/pacemaker>~]# crontab -l
> *>* */1 * * * * /root/test.sh > /dev/null 2>&1
> *>
> >* I get the following output in the log.
> *>* Returned:1
> *>* Returned:1
> *>* Returned:1
> *>* Returned:1
> *>* Returned:1
> *>* Returned:1
> *>* Returned:1
> *>
> >* Has anyone run into this issue before?
> *>
> >
> >
> >
> >
> >
> >* _______________________________________________
> *>* Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> <http://oss.clusterlabs.org/mailman/listinfo/pacemaker> *>*
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> *>
> >* Project Home: http://www.clusterlabs.org
> *>* Getting started:
> http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> *>* Bugs:
> *>*
> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
> *>
> >


-- 
/* Arturo Borrero Gonzalez || cer.inet at linuxmail.org */
/* Use debian gnu/linux! Best OS ever! */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20111030/31d1b59d/attachment-0003.html>


More information about the Pacemaker mailing list