]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - base/dist/osgi-boot/src/main/rpm/etc/osgiboot/osgi-service-init-functions.sh
3 # Source function library.
4 .
/etc
/rc.d
/init.d
/functions
10 # create log an run directories writable by the application user
15 if [ ! -d $LOG_DIR ];then
16 mkdir
-m 0750 $LOG_DIR
17 chown
-R $USER.
$GROUP $LOG_DIR
19 if [ ! -d $RUN_DIR ];then
20 mkdir
-m 0750 $RUN_DIR
21 chown
-R $USER.
$GROUP $RUN_DIR
24 # call Argeo Commons OSGi utilities as the application user
25 daemon
--user $USER /usr
/sbin
/osgi-service
$APP start
28 #action $"Start $APP" /bin/true
29 if [ $RETVAL -eq 0 ];then
30 PID
=`cat $RUN_DIR/$APP.pid`
31 action $
"Started $APP with pid $PID" /bin
/true
33 action $
"Could not start $APP" /bin
/false
41 # call Argeo Commons OSGi utilities as the application user
42 runuser
-s /bin
/bash
$USER -c "/usr/sbin/osgi-service $APP stop"
44 if [ $RETVAL -eq 0 ];then
45 action $
"Stopped $APP" /bin
/true
47 action $
"Could not stop $APP" /bin
/false
52 osgi_service_status
() {
55 # call Argeo Commons OSGi utilities as the application user
56 runuser
-s /bin
/bash
$USER -c "/usr/sbin/osgi-service $APP status"