]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - osgi/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
/osgiboot
/lib
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 -Dosgi.bundles
="org.argeo.osgi.boot.jar@start" \
52 -Dargeo.osgi.bundles
="$CONF_DIR/modules;in=*,$LIB_DIR;in=*" \
53 -Dargeo.osgi.shutdownFile
="$SHUTDOWN_FILE" \
54 -Dlog4j.configuration
="file:$CONF_DIR/log4j.properties" \
55 $JAVA_OPTS -jar $OSGI_FRAMEWORK \
57 -configuration "$CONF_RW" \
60 # (above) stderr redirected to stdout, then stdout to log file
61 # see http://tldp.org/LDP/abs/html/io-redirection.html
64 #echo Started $APP with pid $PID
69 if [ -f $PID_FILE ];then
71 kill -0 $PID &> /dev
/null
73 if [ $PID_EXISTS -ne 0 ]; then
74 echo Dead
$APP process with pid
$PID, removing
$PID_FILE
80 echo $APP is not running
85 # notifies application by removing the shutdown file
88 # wait 5 min for application to shutdown, then kill it
91 while kill -0 $PID &> /dev
/null
95 DURATION
=$
(($NOW-$BEGIN))
96 if [ $DURATION -gt $TIMEOUT ]; then
98 echo Forcibly killed
$APP with pid
$PID
107 # timeout is only available in EL6
108 # timeout 5m sh << EOF
109 #while kill -0 $PID &> /dev/null; do sleep 1; done
112 # if [ $TIMEOUT_EXIT -eq 124 ];then
115 # echo Killed $APP with pid $PID
117 # echo Stopped $APP with pid $PID
124 if [ -f $PID_FILE ];then
127 echo $APP is not running
130 kill -0 $PID &> /dev
/null
132 if [ $PID_EXISTS -eq 0 ]; then
133 echo $APP is running with pid
$PID ...
135 echo No
$APP process with pid
$PID, removing
$PID_FILE
153 echo $
"Usage: $0 {start|stop|status}"