]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - dist/argeo-node/base/bin/argeo-cms
7 BASE_DIR
="$(cd "$
(dirname "$0")/..
"; pwd -P)"
10 # Directories and files
11 CONF_DIR
=$BASE_DIR/etc
/$APP
12 CONF_DIRS
=$CONF_DIR/conf.d
13 BASE_CONFIG_INI
=$BASE_DIR/share
/$APP/config.ini
16 DATA_DIR
=$EXEC_DIR/data
17 CONF_RW
=$EXEC_DIR/state
18 CONFIG_INI
=$CONF_RW/config.ini
20 A2_SOURCES
=a2
://$BASE_DIR/share
/osgi
21 OSGI_INSTALL_AREA
=$BASE_DIR/share
/osgi
/boot
22 OSGI_FRAMEWORK
=$OSGI_INSTALL_AREA/org.eclipse.osgi.jar
25 if [ -f $CONF_DIR/settings.sh
];then
26 .
$CONF_DIR/settings.sh
36 printf "## Equinox configuration - Generated by argeo-cms ##\n\n" > $CONFIG_INI
37 cat $BASE_CONFIG_INI >> $CONFIG_INI
38 printf "\n##\n## $CONF_DIR/$APP.ini\n##\n\n" >> $CONFIG_INI
39 cat $CONF_DIR/$APP.ini
>> $CONFIG_INI
40 for file in `ls -v $CONF_DIRS/*.ini`; do
41 printf "\n##\n## $file\n##\n\n" >> $CONFIG_INI
42 cat $file >> $CONFIG_INI
47 -Dlog4j.configuration
="file:$CONF_DIR/log4j.properties" \
48 $JAVA_OPTS -jar $OSGI_FRAMEWORK \
49 -Dargeo.osgi.sources
=$A2_SOURCES \
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
100 if [ -f $PID_FILE ];then
103 echo $APP is not running
106 kill -0 $PID &> /dev
/null
108 if [ $PID_EXISTS -eq 0 ]; then
109 echo $APP is running with pid
$PID ...
111 echo No
$APP process with pid
$PID, removing
$PID_FILE