ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/webtools-base.spec
(Generate patch)

Comparing COMP/CMSDIST/webtools-base.spec (file contents):
Revision 1.1 by valya, Wed Oct 8 19:16:28 2008 UTC vs.
Revision 1.4 by valya, Thu Oct 9 12:43:40 2008 UTC

# Line 39 | Line 39 | perl -p -i -e 's|source /etc/profile\.d/
39   mkdir -p %i/etc
40   mkdir -p %i/bin
41   mkdir -p %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Applications
42 rm -rf Applications/base
42   cp -r Applications/base %i/lib/python`echo $PYTHON_VERSION | cut -d. -f1,2`/site-packages/Applications
43   cp cmsWeb %i/bin
44 +
45 +
46 + cat << \EOF > %i/bin/base_init
47 + #!/bin/bash
48 + #
49 + # dbs_discovery This script runs CMS DBS Data Discovery service
50 + #
51 + # chkconfig: 345 05 95
52 +
53 + if [ -z ${WEBTOOLS_BASE_ROOT} ]; then
54 +   echo $"The WEBTOOLS_BASE_ROOT environment is not set"
55 +   exit 1
56 + fi
57 +
58 + RETVAL=$?
59 +
60 + port=7999
61 + pid=`ps auxw | grep WSServer | grep -v grep | awk '{print $2}'`
62 + base=base
63 + if [ -n "$WEBTOOLS_BASEURL" ]; then
64 +    url="$WEBTOOLS_BASEURL/$base"
65 + else
66 +    url="http://cmsweb.cern.ch/$base"
67 + fi
68 + cmd="cmsWeb --base-url=$url --port $port --default-page /WSServer"
69 +
70 + case "$1" in
71 + restart)
72 +        echo $"Checking for existing WSServer..."
73 +        if [ ! -z ${pid} ]; then
74 +          kill -9 ${pid}
75 +        fi
76 +        echo $"Restart WSServer..."
77 +        nohup ${cmd} 2>&1 1>& /dev/null < /dev/null &
78 +        ;;
79 + start)
80 +        if [ ! -z ${pid} ]; then
81 +          kill -9 ${pid}
82 +        fi
83 +        nohup ${cmd} 2>&1 1>& /dev/null < /dev/null &
84 +        ;;
85 + status)
86 +        if [ ! -z ${pid} ]; then
87 +          echo $"${base} is running, pid=${pid}"
88 +          exit 0
89 +        fi
90 +        echo $"${base} is stopped"
91 +        exit 3
92 +        ;;
93 + stop)
94 +        if [ ! -z ${pid} ]; then
95 +          kill -9 ${pid}
96 +        fi
97 +        ;;
98 + *)
99 +        echo $"Usage: $0 {start|stop|status|restart}"
100 +        exit 1
101 +        ;;
102 + esac
103 +
104 + exit $RETVAL
105 +
106 + EOF
107 + chmod a+x %i/bin/base_init
108 +
109   %post
110   %{relocateConfig}etc/profile.d/dependencies-setup.sh
111   %{relocateConfig}etc/profile.d/dependencies-setup.csh

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines