OpenVZ Forum


Home » General » Support » LSB init script for each VPS (Need init script for each VPS)
Re: LSB init script for each VPS [message #38280 is a reply to message #38244] Thu, 03 December 2009 15:37 Go to previous messageGo to previous message
webofunni is currently offline  webofunni
Messages: 10
Registered: March 2009
Junior Member
Thanks curx,

I have made some modifications to make that Linux LSB compatible.

#!/bin/bash

_VZCTL="/usr/sbin/vzctl"
_VZLIST="/usr/sbin/vzlist"
_VZLIST_OPTS="-Hostatus"
status()
{
STAT=`/usr/sbin/vzlist -Hostatus 105`
if [ $STAT = "running" ];then
echo "running"
return 0
else
echo "stopped"
return 3
fi
}
case "$1" in
    start)
        $_VZCTL $1 105
        ;;
    stop)
        $_VZCTL $1 105
        ;;
    status)
        status
        RETVAL=$?
        ;;
    *)
        echo "Usage: havps1 {start|stop|status}"
        exit 1
        ;;
esac
exit $RETVAL


I have another question.

The above script will give the status of the VPS and using that I can do the fail over. But the status will not help, if the VPS is in some resource problem like resource failure in UBC and VPS is in crashed state. But the status will be showing as running.

Is there any method to monitor the resource failure also ?

Any idea ? What is the best method ?


Regards,
Unni
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: bug in vzctl 3.0.23-1pve3
Next Topic: dlm in openvz kernel
Goto Forum:
  


Current Time: Thu Oct 09 23:24:40 GMT 2025

Total time taken to generate the page: 0.08793 seconds