#! /bin/sh
# Generated by ../utrans from:
#  de718691081fbceb07b5338f5dabec659b76bc404769356bc8c3ae27b375984e  ./input/sssd.service

# kFreeBSD does not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
   set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: sssd
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Start-Before: systemd-user-sessions
# X-Stop-After: systemd-user-sessions
# Description: System Security Services Daemon
### END INIT INFO
DESC="System Security Services Daemon"
DAEMON="/usr/sbin/sssd"
DEBUG_LOGGER=--logger="--logger=files"
[ -r /etc/default/sssd ] && . /etc/default/sssd
DAEMON_ARGS="-i ${DEBUG_LOGGER}"
SETPRIV_ARGS="--securebits +noroot,+noroot_locked --bounding-set -all,+SETGID,+SETUID,+DAC_READ_SEARCH"
PIDFILE="/run/sssd.pid"
START_ARGS="--background --make-pidfile --notify-await --chuid root:root"
do_start_prepare() {
  /bin/chown -f -R root:root /etc/sssd || true
  /bin/chmod -f -R g+r /etc/sssd || true
  /bin/sh -c "/bin/chown -f root:root /var/lib/sss/db/*.ldb" || true
  /bin/chown -f -R root:root /var/lib/sss/gpo_cache || true
  /bin/sh -c "/bin/chown -f root:root /var/log/sssd/*.log" || true
  ( # Triggering conditions
   ( [ -d '/etc/sssd/conf.d/' ] && files=$(ls -qA -- '/etc/sssd/conf.d/') && [ -n "$files" ] ) ||
   ( [ -e '/etc/sssd/sssd.conf' ] ) 
  ) || do_start_cmd_override() { log_warning_msg " .. Skipped due to no Triggering Conditions" ; }
}
