Skip to content

Commit

Permalink
Merge pull request #337 from pascalrobert/rpm_builds
Browse files Browse the repository at this point in the history
Adding startup scripts for RedHat/CentOS/Fedora and Ubuntu
  • Loading branch information
Pascal Robert committed Dec 3, 2012
2 parents 842f2d8 + 3cf6e4d commit 32f985c
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Utilities/Linux/StartupScripts/RedHat/womonitor
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# chkconfig: - 90 20
# description: Provides JavaMonitor service

# Source function library.
. /etc/rc.d/init.d/functions

NEXT_ROOT="/opt"
export NEXT_ROOT

PATH="/bin:/usr/bin:/usr/java/latest/bin"
export PATH

USER=appserver

# See how we were called.
case "$1" in
start)
echo -n "Starting JavaMonitor: "
        su $USER -c "$NEXT_ROOT/Local/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 &"
echo
;;
stop)
echo -n "Shutting down JavaMonitor: "
        MONITOR_PID=`ps aux | awk '/WOPort 56789/ && !/awk/ {print $2}'`
        kill $MONITOR_PID
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo -n "Usage: $0 {start|stop|restart}"
exit 1
esac

if [ $# -gt 1 ]; then
shift
$0 $*
fi

exit 0
44 changes: 44 additions & 0 deletions Utilities/Linux/StartupScripts/RedHat/wotaskd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# chkconfig: - 90 20
# description: Provides wotaskd service

# Source function library.
. /etc/rc.d/init.d/functions

NEXT_ROOT="/opt"
export NEXT_ROOT

PATH="/bin:/usr/bin:/usr/java/latest/bin"
export PATH

USER=appserver

# See how we were called.
case "$1" in
start)
echo -n "Starting wotaskd: "
su $USER -c "$NEXT_ROOT/Local/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd -WOPort 1085 &"
echo
;;
stop)
echo -n "Shutting down wotaskd: "
WOTASKD_PID=`ps aux | awk '/WOPort 1085/ && !/awk/ {print $2}'`
kill $WOTASKD_PID
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo -n "Usage: $0 {start|stop|restart}"
exit 1
esac

if [ $# -gt 1 ]; then
shift
$0 $*
fi

exit 0
18 changes: 18 additions & 0 deletions Utilities/Linux/StartupScripts/Ubuntu/womonitor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
description "Start JavaMonitor service"
author "David LeBer"

start on runlevel [2345]
stop on runlevel [!2345]

env USER=appserver
env NEXT_ROOT=/opt
env WOMONITOR_LOG=/var/log/webobjects/womonitor.log

respawn
respawn limit 15 5

script
echo "Launching JavaMonitor"
su - $USER -c "$NEXT_ROOT/Local/Library/WebObjects/JavaApplications/JavaMonitor.woa/JavaMonitor -WOPort 56789 >> $WOMONITOR_LOG 2>&1"
emit womonitor_running
end script
18 changes: 18 additions & 0 deletions Utilities/Linux/StartupScripts/Ubuntu/wotaskd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
description "Start wotaskd service"
author "David LeBer"

start on runlevel [2345]
stop on runlevel [!2345]

env USER=appserver
env NEXT_ROOT=/opt
env WOTASKD_LOG=/var/log/webobjects/wotaskd.log

respawn
respawn limit 15 5

script
echo "Launching wotaskd"
su - $USER -c "$NEXT_ROOT/Local/Library/WebObjects/JavaApplications/wotaskd.woa/wotaskd -WOPort 1085 >> $WOTASKD_LOG 2>&1"
emit wotaskd_running
end script

0 comments on commit 32f985c

Please sign in to comment.