/[pdpsoft]/nl.nikhef.pdp.fetchcrl/tags/fetch-crl-3.0.17-2/fetch-crl-boot.init
ViewVC logotype

Annotation of /nl.nikhef.pdp.fetchcrl/tags/fetch-crl-3.0.17-2/fetch-crl-boot.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2690 - (hide annotations) (download)
Tue Mar 4 16:26:06 2014 UTC (7 years, 8 months ago) by davidg
Original Path: nl.nikhef.pdp.fetchcrl/trunk/fetch-crl-boot.init
File size: 1481 byte(s)
Add rcmode option and no re-run of boot script (first version)

1 davidg 1758 #!/bin/sh
2     #
3     # fetch-crl-boot This shell script trigger a run of fetch-crl at boot time
4     #
5     # chkconfig: - 65 01
6     #
7     # description: Run of fetch-crl, a crl updater, on boot up
8     # processname: fetch-crl
9 davidg 1878 # config: /etc/fetch-crl.conf
10 davidg 1758 # config: /etc/sysconfig/fetch-crl
11     #
12    
13     # fetch-crl-boot must run after the start of xinetd and afs, since the URLs
14     # may point to files on an AFS file system or to xinetd-based service URLs
15    
16     # source function library
17     . /etc/rc.d/init.d/functions
18    
19     # source any environment settings, e.g. for HTTP proxies
20     [ -f /etc/sysconfig/fetch-crl ] && . /etc/sysconfig/fetch-crl
21    
22     lockfile=/var/lock/subsys/fetch-crl-boot
23    
24     RETVAL=0
25    
26     start() {
27 davidg 2690 if [ ! -f $lockfile ]; then
28     action $"Running fetch-crl on boot: " /usr/sbin/fetch-crl -q
29     RETVAL=$?
30     [ "$RETVAL" = 0 ] && touch $lockfile
31     else
32     RETVAL=0
33     fi
34 davidg 1758 }
35    
36     stop() {
37     RETVAL=0
38     [ "$RETVAL" = 0 ] && rm -f $lockfile
39     }
40    
41     case "$1" in
42     start)
43     start
44     ;;
45     stop)
46     stop
47     ;;
48     restart|force-reload)
49     $0 stop
50     $0 start
51     ;;
52     condrestart)
53     [ -f $lockfile ] && {
54     $0 stop
55     $0 start
56     }
57     ;;
58     reload)
59     ;;
60     status)
61     if [ -f $lockfile ] ; then
62     echo -n $"fetch-crl-boot lockfile present" && success
63     RETVAL=0
64     else
65     echo -n $"fetch-crl-boot lockfile missing" && failure
66     RETVAL=1
67     fi
68     echo
69     ;;
70     *)
71     echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
72     exit 1
73     esac
74    
75     exit $RETVAL

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28