]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - dist/osgi-boot/src/main/rpm/usr/sbin/osgi-service
4 .
/etc
/osgiboot
/osgi-service-settings.sh
9 if [ -f $CONF_DIR/settings.sh
];then
10 .
$CONF_DIR/settings.sh
13 LIB_DIR
=/usr
/share
/$APP/lib
16 EXEC_DIR
=/var
/lib
/$APP
17 DATA_DIR
=$EXEC_DIR/data
18 CONF_RW
=$EXEC_DIR/conf
21 LOG_FILE
=$LOG_DIR/$APP.log
24 PID_FILE
=$RUN_DIR/$APP.pid
25 SHUTDOWN_FILE
=$RUN_DIR/$APP.shutdown
27 OSGI_INSTALL_AREA
=/usr
/share
/osgi
/boot
28 OSGI_FRAMEWORK
=$OSGI_INSTALL_AREA/org.eclipse.osgi.jar
33 if [ -f $PID_FILE ];then
35 kill -0 $PID &> /dev
/null
37 if [ $PID_EXISTS -eq 0 ]; then
38 echo $APP already running with pid
$PID
42 echo Old
$APP process with pid
$PID is dead
, removing
$PID_FILE
47 cp --preserve $CONF_DIR/config.ini
$CONF_RW/config.ini
51 -Dargeo.osgi.shutdownFile
="$SHUTDOWN_FILE" \
52 -Dlog4j.configuration
="file:$CONF_DIR/log4j.properties" \
53 $JAVA_OPTS -jar $OSGI_FRAMEWORK \
55 -configuration "$CONF_RW" \
58 # (above) stderr redirected to stdout, then stdout to log file
59 # see http://tldp.org/LDP/abs/html/io-redirection.html
62 #echo Started $APP with pid $PID
67 if [ -f $PID_FILE ];then
69 kill -0 $PID &> /dev
/null
71 if [ $PID_EXISTS -ne 0 ]; then
72 echo Dead
$APP process with pid
$PID, removing
$PID_FILE
78 echo $APP is not running
83 # notifies application by removing the shutdown file
86 # wait 5 min for application to shutdown, then kill it
89 while kill -0 $PID &> /dev
/null
93 DURATION
=$
(($NOW-$BEGIN))
94 if [ $DURATION -gt $TIMEOUT ]; then
96 echo Forcibly killed
$APP with pid
$PID
105 # timeout is only available in EL6
106 # timeout 5m sh << EOF
107 #while kill -0 $PID &> /dev/null; do sleep 1; done
110 # if [ $TIMEOUT_EXIT -eq 124 ];then
113 # echo Killed $APP with pid $PID
115 # echo Stopped $APP with pid $PID
122 if [ -f $PID_FILE ];then
125 echo $APP is not running
128 kill -0 $PID &> /dev
/null
130 if [ $PID_EXISTS -eq 0 ]; then
131 echo $APP is running with pid
$PID ...
133 echo No
$APP process with pid
$PID, removing
$PID_FILE
151 echo $
"Usage: $0 {start|stop|status}"