Test Page: Difference between revisions
From OpenSimulator
Jump to navigationJump to search
imported>BlueWall |
imported>BlueWall |
||
| Line 44: | Line 44: | ||
TIME="Simulator Down, Restarting: `/usr/bin/date +"%A, %B %d - %r"`" | TIME="Simulator Down, Restarting: `/usr/bin/date +"%A, %B %d - %r"`" | ||
echo | echo $TIME >>$LOG/OSGReport.txt | ||
cd $RUN | cd $RUN | ||
$SCREEN -S OSG -d -m mono OpenSim.exe | $SCREEN -S OSG -d -m mono OpenSim.exe | ||
fi | fi | ||
# All Done 'Till Next Time | # All Done 'Till Next Time | ||
Revision as of 23:03, 19 June 2008
Open Sim Watchdog Script
This is a small script to watch for an OpenSim region simulator under screen in Linux. If the process is missing, a new instance will be started.
oswatchdog
<source lang="bash">
- !/bin/sh
- THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- Adjust To Your System:
- Sample Cron Entry: Runs Each Minute 24/7/365
- */1 * * * * exec /opt/opensim/scripts/oswatchdog
- Where Does Your OpenSim Installation Live?
BASE="/opt/opensim"
- Where Do You Run OpenSim.exe From?
RUN="$BASE/production/bin"
- Where Do You Want To Log Events To?
LOG="$BASE/log"
- Where Is Your Screen Binary?
SCREEN="/usr/bin/screen"
- Check For For Our Screen Process, Named OSG
running=`ps ax|grep OSG|grep -v grep`
- If The Process Is Not There...
if [ -z "$running" ]; then #...We Make A Log Entry And Start A New One # The Log Entry TIME="Simulator Down, Restarting: `/usr/bin/date +"%A, %B %d - %r"`"
echo $TIME >>$LOG/OSGReport.txt cd $RUN $SCREEN -S OSG -d -m mono OpenSim.exe fi
- All Done 'Till Next Time