sssd.in revision 636caee5776fb062fde39bc761df142005dcb589
7fb4c0766e858653c9776474005a6ae6d94828afgryzor#!/bin/sh
7fb4c0766e858653c9776474005a6ae6d94828afgryzor#
7fb4c0766e858653c9776474005a6ae6d94828afgryzor#
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# chkconfig: - 12 88
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# description: Provides a set of daemons to manage access to remote directories
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# and authentication mechanisms. It provides an NSS and PAM
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# interface toward the system and a pluggable backend system to
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# connect to multiple different account sources. It is also the
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# basis to provide client auditing and policy services for projects
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# like FreeIPA.
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen#
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen### BEGIN INIT INFO
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# Provides: sssd
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# Required-Start: $remote_fs $time
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# Should-Start: $syslog
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# Should-Stop: $null
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen# Required-Stop: $null
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# Default-Stop: 0 1 6
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# Short-Description: System Security Services Daemon
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# Description: Provides a set of daemons to manage access to remote directories
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# and authentication mechanisms. It provides an NSS and PAM
3f08db06526d6901aa08c110b5bc7dde6bc39905nd# interface toward the system and a pluggable backend system to
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# connect to multiple different account sources. It is also the
7fb4c0766e858653c9776474005a6ae6d94828afgryzor# basis to provide client auditing and policy services for projects
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung# like FreeIPA.
7fb4c0766e858653c9776474005a6ae6d94828afgryzor### END INIT INFO
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
7fb4c0766e858653c9776474005a6ae6d94828afgryzorRETVAL=0
f9442c8a9869d3525a1ae6ed3e85c65d408e8a70sfprog="sssd"
f9442c8a9869d3525a1ae6ed3e85c65d408e8a70sf
f9442c8a9869d3525a1ae6ed3e85c65d408e8a70sf# Source function library.
f9442c8a9869d3525a1ae6ed3e85c65d408e8a70sf. /etc/init.d/functions
f9442c8a9869d3525a1ae6ed3e85c65d408e8a70sf
7fb4c0766e858653c9776474005a6ae6d94828afgryzorif [ -f @environment_file@ ]; then
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic . @environment_file@
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalicfi
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzorSSSD=@sbindir@/sssd
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzor
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzorLOCK_FILE=@localstatedir@/lock/subsys/sssd
7fb4c0766e858653c9776474005a6ae6d94828afgryzorPID_FILE=@localstatedir@/run/sssd.pid
b03f9485e6dfcf9326e6122f91eaa1ced8939818jim
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohstart() {
7fb4c0766e858653c9776474005a6ae6d94828afgryzor [ -x $SSSD ] || exit 5
7fb4c0766e858653c9776474005a6ae6d94828afgryzor echo -n $"Starting $prog: "
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic daemon $SSSD -f -D
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic RETVAL=$?
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic echo
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic [ "$RETVAL" = 0 ] && touch $LOCK_FILE
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic return $RETVAL
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic}
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedoohstop() {
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh echo -n $"Stopping $prog: "
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh pid=`cat $PID_FILE`
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh killproc -p $PID_FILE $SSSD -TERM
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh RETVAL=$?
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh # Wait until the monitor exits
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh while (checkpid $pid)
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic do
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic usleep 100000
70f5253b24dd333c67fb6502d557a8b48ad3ba87igalic done
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
7fb4c0766e858653c9776474005a6ae6d94828afgryzor echo
7fb4c0766e858653c9776474005a6ae6d94828afgryzor [ "$RETVAL" = 0 ] && rm -f $LOCK_FILE
7fb4c0766e858653c9776474005a6ae6d94828afgryzor return $RETVAL
7fb4c0766e858653c9776474005a6ae6d94828afgryzor}
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
7fb4c0766e858653c9776474005a6ae6d94828afgryzorreload() {
7fb4c0766e858653c9776474005a6ae6d94828afgryzor echo -n $"Reloading $prog: "
7fb4c0766e858653c9776474005a6ae6d94828afgryzor killproc $SSSD -HUP
7fb4c0766e858653c9776474005a6ae6d94828afgryzor RETVAL=$?
7fb4c0766e858653c9776474005a6ae6d94828afgryzor echo
7fb4c0766e858653c9776474005a6ae6d94828afgryzor return $RETVAL
7fb4c0766e858653c9776474005a6ae6d94828afgryzor}
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
7fb4c0766e858653c9776474005a6ae6d94828afgryzorrestart() {
7fb4c0766e858653c9776474005a6ae6d94828afgryzor stop
7fb4c0766e858653c9776474005a6ae6d94828afgryzor start
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh}
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedoohforce_reload() {
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh restart
7fb4c0766e858653c9776474005a6ae6d94828afgryzor}
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzorrh_status() {
9534272616b71aaea50aeec4162e749a96aebd7fsf # run checks to determine if the service is running or use generic status
9534272616b71aaea50aeec4162e749a96aebd7fsf status $prog
9534272616b71aaea50aeec4162e749a96aebd7fsf}
9534272616b71aaea50aeec4162e749a96aebd7fsf
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzorrh_status_q() {
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh rh_status >/dev/null 2>&1
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh}
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedoohcase "$1" in
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh start)
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzor rh_status_q && exit 0
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzor $1
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzor ;;
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
e7eb98e34575dcf6536530bcf08e00d7ab3d3124gryzor stop)
7fb4c0766e858653c9776474005a6ae6d94828afgryzor rh_status_q || exit 0
7fb4c0766e858653c9776474005a6ae6d94828afgryzor $1
7fb4c0766e858653c9776474005a6ae6d94828afgryzor ;;
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
7fb4c0766e858653c9776474005a6ae6d94828afgryzor restart)
7fb4c0766e858653c9776474005a6ae6d94828afgryzor $1
7fb4c0766e858653c9776474005a6ae6d94828afgryzor ;;
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
7fb4c0766e858653c9776474005a6ae6d94828afgryzor reload)
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh rh_status_q || exit 7
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh $1
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh ;;
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh force-reload)
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh force_reload
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh ;;
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh status)
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh rh_status
888cb40bdeec5abf452bd85d6bf63b26d5913d4chumbedooh ;;
7fb4c0766e858653c9776474005a6ae6d94828afgryzor
7fb4c0766e858653c9776474005a6ae6d94828afgryzor condrestart|try-restart)
7fb4c0766e858653c9776474005a6ae6d94828afgryzor rh_status_q || exit 0
7fb4c0766e858653c9776474005a6ae6d94828afgryzor restart
7fb4c0766e858653c9776474005a6ae6d94828afgryzor ;;
7fb4c0766e858653c9776474005a6ae6d94828afgryzor *)
7fb4c0766e858653c9776474005a6ae6d94828afgryzor echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
7fb4c0766e858653c9776474005a6ae6d94828afgryzor exit 2
7fb4c0766e858653c9776474005a6ae6d94828afgryzoresac
7fb4c0766e858653c9776474005a6ae6d94828afgryzorexit $?
7fb4c0766e858653c9776474005a6ae6d94828afgryzor