Changeset 435 for trunk/pkg/rpm
- Timestamp:
- 07/11/07 16:57:42 (16 years ago)
- Location:
- trunk/pkg/rpm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pkg/rpm/init.d/jobarchived
r429 r435 1 #! /bin/sh 1 #!/bin/sh 2 # 3 # Init file for the Job Archiving Daemon 4 # 5 # chkconfig: 2345 20 80 6 # description: jobarchived archives information on nodes in RRDS and batch jobs in SQL 7 # 8 # processname: jobarchived 9 # config: /etc/jobarchived.conf 10 # config: /etc/sysconfig/jobarchived 11 # pidfile: /var/run/jobarchived 2 12 3 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 4 DAEMON=/usr/bin/jobarchived 5 NAME=jobarchived 6 DESC="Job Archive Daemon" 13 # Source function library. 14 . /etc/rc.d/init.d/functions 7 15 8 export PYTHONPATH=/usr/share/jobarchived:$PYTHONPATH 16 RETVAL=0 17 name=jobarchived 18 prog=/usr/sbin/jobarchived 19 desc="Job Archiving Daemon" 9 20 10 test -x $DAEMON || exit 0 21 if [ -r /etc/sysconfig/$name ]; then 22 source /etc/sysconfig/$name 23 fi 11 24 12 set -e 25 start() { 26 echo -n $"Starting $desc: " 27 daemon $prog -p /var/run/$name.pid $OPTIONS 28 RETVAL=$? 29 echo 30 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name 31 return $RETVAL 32 } 33 34 stop() { 35 echo -n $"Stopping $desc: " 36 killproc $prog 37 RETVAL=$? 38 echo 39 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name 40 return $RETVAL 41 } 42 43 restart() { 44 stop 45 start 46 } 13 47 14 48 case "$1" in 15 start) 16 echo -n "Starting $DESC: " 17 start-stop-daemon --start --quiet -m --pidfile /var/run/$NAME.pid \ 18 --exec $DAEMON 19 sleep 1 20 ps -ef | grep jobarchived$ | awk '{ print $2 }' >/var/run/$NAME.pid 21 echo "$NAME." 22 ;; 23 stop) 24 echo -n "Stopping $DESC: " 25 start-stop-daemon --stop --quiet --oknodo --name $DAEMON \ 26 2>&1 > /dev/null 27 sleep 1 28 test -f /var/run/$NAME.pid && MYPID=`cat /var/run/$NAME.pid` 29 test ! -z $MYPID && ps $MYPID 2>&1 > /dev/null && kill -9 $MYPID 2>&1 > /dev/null 30 echo "$NAME." 31 ;; 32 restart|force-reload) 33 $0 stop 34 $0 start 35 ;; 36 *) 37 echo "Usage: $N {start|stop|restart}" >&2 38 exit 1 39 ;; 49 start) 50 start 51 ;; 52 stop) 53 stop 54 ;; 55 restart) 56 restart 57 ;; 58 condrestart) 59 [ -e /var/lock/subsys/$name ] && restart 60 RETVAL=$? 61 ;; 62 status) 63 status python 64 RETVAL=$? 65 ;; 66 *) 67 echo $"Usage: $0 {start|stop|restart|condrestart|status}" 68 RETVAL=1 40 69 esac 41 70 42 exit 071 exit $RETVAL -
trunk/pkg/rpm/jobmonarch-jobarchived.spec
r390 r435 40 40 41 41 /etc/init.d/jobarchived stop 42 43 44 %postun45 #!/bin/sh46 47 PATH=/bin:/sbin:/usr/bin:/usr/sbin48 49 42 chkconfig jobarchived off 50 43 … … 56 49 57 50 %files 58 "/usr/bin/jobarchived.py" 51 "/usr/sbin/jobarchived.py" 52 "/usr/sbin/jobarchived" 59 53 "/etc/init.d/jobarchived" 60 "/etc/jobarchived.conf"61 "/usr/bin/jobarchived"54 %config "/etc/jobarchived.conf" 55 %config "/etc/sysconfig/jobarchived" 62 56 %dir "/usr/share/jobarchived/" 63 57 "/usr/share/jobarchived/job_dbase.sql"
Note: See TracChangeset
for help on using the changeset viewer.