LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Run IPVSADM From Cron

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Run IPVSADM From Cron
From: ipvs user <ipvsuser@xxxxxxxxxxxxxxxx>
Date: Thu, 14 Feb 2008 21:39:22 -0800
Try:

/sbin/ipvsadm -l -n >> /tmp/ipvsadm.out 2>> /tmp/ipvsadm.err

That way, you eliminate dns, permissions, and you can see if there is some 
stderr output rather than stdout output.

Also try :
#!/bin/bash -x
and redirect both stdout and stderr to separate files
* * * * * cd /blah;./ipvsadmstatus.sh > ipvsstat.out 2> ipvsstat.err

Jason Ledford wrote:
> This is my script now:
> #!/bin/bash
> cat /usr/src/ha/ipvsmessage > /var/www/active/index.html
> date >> /var/www/active/index.html
> echo "<br>" >> /var/www/active/index.html
> /sbin/ipvsadm > /usr/src/ha/ipvshtml.tmp
> /bin/sed -e s/$/\<br\>/ /usr/src/ha/ipvshtml.tmp >> /var/www/active/index.html
> 
> And everything works except the ipvsadm part, it creates the file 
> ipvshtml.tmp but the file is blank.
> 
> Thanks for your help.
> 
> -----Original Message-----
> From: lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:lvs-users-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Joseph Mack 
> NA3T
> Sent: Wednesday, February 13, 2008 8:08 AM
> To: LinuxVirtualServer.org users mailing list.
> Subject: Re: [lvs-users] Run IPVSADM From Cron
> 
> On Tue, 12 Feb 2008, Jason Ledford wrote:
> 
>> /sbin/ipvsadm | sed -e s/$/\<br\>/ > /var/www/active/index.html
>>
>> I am trying to run this to create a web page that can be
>> checked to see what director is active and show the
>> routing table.  The script runs just fine if I execute it.
>> But when cron runs everything in the script runs except
>> the ipvsadm part, it just seems to not do anything.
> 
> cron has the PATH=/bin:/usr/bin and all directories for
> files have to be explicite. Is sed in cron's PATH? Break the
> ipvsadm line up. What if you do
> 
> # /sbin/ipvsadm | logger
> 
> Joe
> --
> Joseph Mack NA3T EME(B,D), FM05lw North Carolina
> jmack (at) wm7d (dot) net - azimuthal equidistant map
> generator at http://www.wm7d.net/azproj.shtml
> Homepage http://www.austintek.com/ It's GNU/Linux!
> 
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
> 
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users


<Prev in Thread] Current Thread [Next in Thread>