Changeset 435 for trunk/pkg


Ignore:
Timestamp:
07/11/07 16:57:42 (14 years ago)
Author:
bastiaans
Message:

jobarchived/jobarchived.py:

  • added pidfile support

pkg/rpm/init.d/jobarchived,
pkg/rpm/jobmonarch-jobarchived.spec,
Makefile:

  • updated
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
    212
    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
    715
    8 export PYTHONPATH=/usr/share/jobarchived:$PYTHONPATH
     16RETVAL=0
     17name=jobarchived
     18prog=/usr/sbin/jobarchived
     19desc="Job Archiving Daemon"
    920
    10 test -x $DAEMON || exit 0
     21if [ -r /etc/sysconfig/$name ]; then
     22        source /etc/sysconfig/$name
     23fi
    1124
    12 set -e
     25start() {
     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
     34stop() {
     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
     43restart() {
     44        stop
     45        start
     46}
    1347
    1448case "$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
    4069esac
    4170
    42 exit 0
     71exit $RETVAL
  • trunk/pkg/rpm/jobmonarch-jobarchived.spec

    r390 r435  
    4040
    4141/etc/init.d/jobarchived stop
    42 
    43 
    44 %postun
    45 #!/bin/sh
    46 
    47 PATH=/bin:/sbin:/usr/bin:/usr/sbin
    48 
    4942chkconfig jobarchived off
    5043
     
    5649
    5750%files
    58 "/usr/bin/jobarchived.py"
     51"/usr/sbin/jobarchived.py"
     52"/usr/sbin/jobarchived"
    5953"/etc/init.d/jobarchived"
    60 "/etc/jobarchived.conf"
    61 "/usr/bin/jobarchived"
     54%config "/etc/jobarchived.conf"
     55%config "/etc/sysconfig/jobarchived"
    6256%dir "/usr/share/jobarchived/"
    6357"/usr/share/jobarchived/job_dbase.sql"
Note: See TracChangeset for help on using the changeset viewer.