<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div style="font-family: lucida console,sans-serif;"><font size="3">Hi All,</font></div><div style="font-family: lucida console,sans-serif;"><font size="3"><br></font></div><div style="font-family: lucida console,sans-serif;"><font size="3">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.</font></div><div style="font-family: lucida console,sans-serif;"><font size="3"><br></font></div><div style="font-family: lucida console,sans-serif;"><font size="3">Here's a test script I wrote to test this issue.</font></div><div style="font-family: lucida console,sans-serif;"><br></div><div><br></div><div style="font-family: verdana,helvetica,sans-serif;">[root@BLRACE70 ~]# cat test.sh<br>#!/bin/sh<br><br>/usr/sbin/crm status
>> /var/log/cron_log.log<br>echo "Returned:$?" >> /var/log/cron_log.log</div><div><br></div><div><br></div><div style="font-family: lucida console,sans-serif;"><font size="3">If I run the above file manually. I get output as below in the log:</font></div><div><br></div><div style="font-family: verdana,helvetica,sans-serif;"><font size="2">============<br>Last updated: Fri Oct 28 17:14:07 2011<br>Stack: openais<br>Current DC: aceblr073.com - partition with quorum<br>Version: 1.1.5-5.el6-01e86afaaa6d4a8c4836f68df80ababd6ca3902f<br>2 Nodes configured, 1 expected votes<br>2 Resources configured.<br>============<br><br>Online: [ aceblr073.com BLRACE70 ]<br><br> Resource Group: HAService<br> FloatingIP (ocf::heartbeat:IPaddr2): Started aceblr073.com<br> acestatus (lsb:acestatus): Started
aceblr073.com<br> Clone Set: pingdclone [pingd]<br> Started: [ aceblr073.com BLRACE70 ]<br>Returned:0</font></div><div><br></div><div><br></div><div style="font-family: lucida console,sans-serif;"><font size="3">If I schedule it through cron as below:</font></div><div><br></div><div style="font-family: verdana,helvetica,sans-serif;"><font size="1"><span><br></span></font></div><div style="font-family: verdana,helvetica,sans-serif;"><font size="2"><span>[root@BLRACE70 ~]# crontab -l</span><br>*/1 * * * * /root/test.sh > /dev/null 2>&1</font></div><div style="font-family: verdana,helvetica,sans-serif;"><br></div><div style="font-family: verdana,helvetica,sans-serif;"><br></div><div style="font-family: lucida console,sans-serif;"><font size="3">I get the following output in the log.</font></div><div style="font-family: lucida console,sans-serif;"><br></div><div style="font-family: lucida console,sans-serif;"><font
size="3"><font size="2"><font size="2"><span style="font-family: verdana,helvetica,sans-serif;">Returned:1</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">Returned:1</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">Returned:1</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">Returned:1</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">Returned:1</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">Returned:1</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">Returned:1</span></font><br style="font-family: verdana,helvetica,sans-serif;"><span
style="font-family: verdana,helvetica,sans-serif;"></span><span style="font-family: verdana,helvetica,sans-serif;"></span></font><br></font></div><div style="font-family: verdana,helvetica,sans-serif;"><font size="3"><span style="font-family: lucida console,sans-serif;">Has anyone run into this issue before?</span></font><br></div><div style="font-family: verdana,helvetica,sans-serif;"><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div></div></div></body></html>