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.3 by valya, Wed Oct 8 23:21:48 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 + cmd = "cmsWeb --base-url=https://cmsweb.cern.ch/base --port $port --default-page /WSServer"
64 +
65 + case "$1" in
66 + restart)
67 +        echo $"Checking for existing WSServer..."
68 +        if [ ! -z ${pid} ]; then
69 +          kill -9 ${pid}
70 +        fi
71 +        echo $"Restart WSServer..."
72 +        nohup ${cmd} 2>&1 1>& /dev/null < /dev/null &
73 +        ;;
74 + start)
75 +        if [ ! -z ${pid} ]; then
76 +          kill -9 ${pid}
77 +        fi
78 +        nohup ${cmd} 2>&1 1>& /dev/null < /dev/null &
79 +        ;;
80 + status)
81 +        if [ ! -z ${pid} ]; then
82 +          echo $"${base} is running, pid=${pid}"
83 +          exit 0
84 +        fi
85 +        echo $"${base} is stopped"
86 +        exit 3
87 +        ;;
88 + stop)
89 +        if [ ! -z ${pid} ]; then
90 +          kill -9 ${pid}
91 +        fi
92 +        ;;
93 + *)
94 +        echo $"Usage: $0 {start|stop|status|restart}"
95 +        exit 1
96 +        ;;
97 + esac
98 +
99 + exit $RETVAL
100 +
101 + EOF
102 +
103   %post
104   %{relocateConfig}etc/profile.d/dependencies-setup.sh
105   %{relocateConfig}etc/profile.d/dependencies-setup.csh

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines