]> git.pld-linux.org Git - packages/sssd.git/blame - sssd.init
- up to 1.12.3
[packages/sssd.git] / sssd.init
CommitLineData
d1d78d42 1#!/bin/sh
2#
3# sssd System Security Services Daemon
4#
5# chkconfig: 2345 84 16
6#
7# description: Cache for LDAP and Kerberos credentials for disconnected use
8#
9# processname: sssd
10# config: /etc/sssd/sssd.conf
11# pidfile: /var/lib/sssd/sssd.pid
12#
13# $Id$
14
15# Source function library
16. /etc/rc.d/init.d/functions
17
18# Get network config
19. /etc/sysconfig/network
20
21# Get service config - may override defaults
22[ -f /etc/sysconfig/sssd ] && . /etc/sysconfig/sssd
23
24# Check that networking is up.
25if is_yes "${NETWORKING}"; then
26 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
27 msg_network_down "System Security Services Daemon"
28 exit 1
29 fi
30else
31 exit 0
32fi
33
34start() {
35 # Check if the service is already running?
6b0861e9 36 if [ -f /var/lock/subsys/sssd ]; then
d1d78d42 37 msg_already_running "System Security Services Daemon"
6b0861e9 38 return
d1d78d42 39 fi
6b0861e9
ER
40
41 msg_starting "System Security Services Daemon"
42 daemon --fork /usr/sbin/sssd --defaults-file=/etc/sssd/sssd.conf
43 RETVAL=$?
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sssd
d1d78d42 45}
46
47stop() {
6b0861e9
ER
48 if [ ! -f /var/lock/subsys/sssd ]; then
49 msg_not_running "System Security Services Daemon"
50 return
51 fi
d1d78d42 52
6b0861e9
ER
53 # Stop daemons.
54 msg_stopping "System Security Services Daemon"
55 /sbin/start-stop-daemon -q --stop \
56 --retry TERM/600/KILL/10 \
57 -s TERM --pidfile /var/lib/sssd/sssd.pid
58 local result=$?
59 if [ "$result" -eq 0 ]; then
60 ok
d1d78d42 61 else
6b0861e9 62 fail
d1d78d42 63 fi
6b0861e9
ER
64
65 rm -f /var/lock/subsys/sssd
d1d78d42 66}
67
68condrestart() {
6b0861e9 69 if [ ! -f /var/lock/subsys/sssd ]; then
d1d78d42 70 msg_not_running "System Security Services Daemon"
71 RETVAL=$1
6b0861e9 72 return
d1d78d42 73 fi
6b0861e9
ER
74
75 stop
76 start
d1d78d42 77}
78
79RETVAL=0
80# See how we were called.
81case "$1" in
82 start)
6b0861e9 83 start
d1d78d42 84 ;;
85 stop)
6b0861e9 86 stop
d1d78d42 87 ;;
88 restart)
89 stop
90 start
91 ;;
92 try-restart)
93 condrestart 0
94 ;;
95 force-reload)
96 condrestart 7
97 ;;
98 status)
99 status sssd
100 RETVAL=$?
101 ;;
102 *)
103 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
104 exit 3
105esac
106
107exit $RETVAL
This page took 0.087013 seconds and 4 git commands to generate.