Subversion Repositories configs

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
#!/bin/sh
2
#
3
#
4
# chkconfig: - 12 88
5
# description: Provides a set of daemons to manage access to remote directories
6
#              and authentication mechanisms. It provides an NSS and PAM
7
#              interface toward the system and a pluggable backend system to
8
#              connect to multiple different account sources. It is also the
9
#              basis to provide client auditing and policy services for projects
10
#              like FreeIPA.
11
#
12
### BEGIN INIT INFO
13
# Provides: sssd
14
# Required-Start: $remote_fs $time
15
# Should-Start: $syslog
16
# Should-Stop: $null
17
# Required-Stop: $null
18
# Default-Stop: 0 1 6
19
# Short-Description: System Security Services Daemon
20
# Description: Provides a set of daemons to manage access to remote directories
21
#              and authentication mechanisms. It provides an NSS and PAM
22
#              interface toward the system and a pluggable backend system to
23
#              connect to multiple different account sources. It is also the
24
#              basis to provide client auditing and policy services for projects
25
#              like FreeIPA.
26
### END INIT INFO
27
 
28
RETVAL=0
29
prog="sssd"
30
 
31
# Source function library.
32
. /etc/init.d/functions
33
 
34
if [ -f /etc/sysconfig/sssd ]; then
35
    . /etc/sysconfig/sssd
36
fi
37
 
38
SSSD=/usr/sbin/sssd
39
 
40
LOCK_FILE=/var/lock/subsys/sssd
41
PID_FILE=/var/run/sssd.pid
42
 
43
start() {
44
    [ -x $SSSD ] || exit 5
45
    echo -n $"Starting $prog: "
8 - 46
    daemon $SSSD -f -D
3 - 47
    RETVAL=$?
48
    echo
49
    [ "$RETVAL" = 0 ] && touch $LOCK_FILE
50
    return $RETVAL
51
}
52
 
53
stop() {
54
    echo -n $"Stopping $prog: "
55
    pid=`cat $PID_FILE`
56
 
57
    killproc -p $PID_FILE $SSSD -TERM
58
    RETVAL=$?
59
 
60
    # Wait until the monitor exits
61
    while (checkpid $pid)
62
    do
63
        usleep 100000
64
    done
65
 
66
    echo
67
    [ "$RETVAL" = 0 ] && rm -f $LOCK_FILE
68
    return $RETVAL
69
}
70
 
71
reload() {
72
    echo -n $"Reloading $prog: "
73
    killproc $SSSD -HUP
74
    RETVAL=$?
75
    echo
76
    return $RETVAL
77
}
78
 
79
restart() {
80
        stop
81
        start
82
}
83
 
84
force_reload() {
85
    restart
86
}
87
 
88
rh_status() {
89
    # run checks to determine if the service is running or use generic status
90
    status $prog
91
}
92
 
93
rh_status_q() {
94
    rh_status >/dev/null 2>&1
95
}
96
 
97
case "$1" in
98
    start)
99
        rh_status_q && exit 0
100
        $1
101
        ;;
102
 
103
    stop)
104
        rh_status_q || exit 0
105
        $1
106
        ;;
107
 
108
    restart)
109
        $1
110
        ;;
111
 
112
    reload)
113
        rh_status_q || exit 7
114
        $1
115
        ;;
116
 
117
    force-reload)
118
        force_reload
119
        ;;
120
 
121
    status)
122
        rh_status
123
        ;;
124
 
125
    condrestart|try-restart)
126
        rh_status_q || exit 0
127
        restart
128
        ;;
129
    *)
130
    echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
131
    exit 2
132
esac
133
exit $?