]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - dist/argeo-node/rpm/usr/sbin/nodectl
6 # Directories and files
8 CONF_DIRS
=/etc
/$APP/conf.d
9 BASE_POLICY_ALL
=/usr
/share
/$APP/all.policy
10 BASE_CONFIG_INI
=/usr
/share
/$APP/config.ini
12 EXEC_DIR
=/var
/lib
/$APP
13 DATA_DIR
=$EXEC_DIR/data
14 CONF_RW
=$EXEC_DIR/state
15 CONFIG_INI
=$CONF_RW/config.ini
17 LOG_FILE
=$LOG_DIR/$APP.log
20 PID_FILE
=$RUN_DIR/$APP.pid
22 OSGI_INSTALL_AREA
=/usr
/share
/osgi
/boot
23 OSGI_FRAMEWORK
=$OSGI_INSTALL_AREA/org.eclipse.osgi.jar
26 if [ -f $CONF_DIR/settings.sh
];then
27 .
$CONF_DIR/settings.sh
35 chown
-R $APP.APP
$EXEC_DIR
38 echo ## Equinox configuration - Generated by /usr/sbin/nodectl > $CONFIG_INI
39 cat $BASE_CONFIG_INI >> $CONFIG_INI
40 cat $CONF_DIR/$APP.ini
>> $CONFIG_INI
41 for file in `ls -v $CONF_DIRS/*.ini`; do
42 echo "\n# $file\n" >> $CONFIG_INI;
43 cat $file >> $CONFIG_INI
48 -Dlog4j.configuration
="file:$CONF_DIR/log4j.properties" \
49 $JAVA_OPTS -jar $OSGI_FRAMEWORK \
50 -configuration "$CONF_RW" \
55 echo Not yet implemented
59 if [ -f $PID_FILE ];then
61 kill -0 $PID &> /dev
/null
63 if [ $PID_EXISTS -ne 0 ]; then
64 echo Dead
$APP process with pid
$PID, removing
$PID_FILE
70 echo $APP is not running
75 # notifies application by removing the shutdown file
76 # rm -f $SHUTDOWN_FILE
79 # wait 10 min for application to shutdown, then kill it
82 while kill -0 $PID &> /dev
/null
86 DURATION
=$
(($NOW-$BEGIN))
87 if [ $DURATION -gt $TIMEOUT ]; then
89 echo Forcibly killed
$APP with pid
$PID
98 # timeout is only available in EL6
99 # timeout 5m sh << EOF
100 #while kill -0 $PID &> /dev/null; do sleep 1; done
103 # if [ $TIMEOUT_EXIT -eq 124 ];then
106 # echo Killed $APP with pid $PID
108 # echo Stopped $APP with pid $PID
115 if [ -f $PID_FILE ];then
118 echo $APP is not running
121 kill -0 $PID &> /dev
/null
123 if [ $PID_EXISTS -eq 0 ]; then
124 echo $APP is running with pid
$PID ...
126 echo No
$APP process with pid
$PID, removing
$PID_FILE
147 echo $
"Usage: $0 {start|stop|status}"