-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfelix
41 lines (39 loc) · 984 Bytes
/
felix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export FELIX_HOME=/felix-framework-4.4.0
export LD_LIBRARY_PATH=.
export PATH=$PATH:$JAVA_HOME/bin
# See how we were called.
case "$1" in
start)
cd $FELIX_HOME
proc_size=`ps -ef|grep felix|grep -v grep|grep -v init.d|wc -l`
if [ $proc_size -gt 0 ]; then
echo "Already running"
exit 1
fi
nohup java -Xcheck:jni -agentlib:ArvueResourceManager=nolimits -cp . -Dgosh.args=--nointeractive -Dorg.osgi.framework.bootdelegation=fi.tut.cloud.arvue.resource -Darvueresourcemanager.home=`pwd` -jar $FELIX_HOME/bin/felix.jar 2>/dev/null &
echo
;;
stop)
for proc_id in `ps -ef|grep felix|grep -v grep|grep -v init.d|sed 's/ */ /g'| cut -d' ' -f2`
do
kill -9 $proc_id
done
echo
;;
status)
proc_size=`ps -ef|grep felix|grep -v grep|grep -v init.d|wc -l`
echo $proc_size
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0