ports/security/sssd/files/sssd.in
Mark Johnston 04b16f6b83 security/sssd*: Use an absolute path in sssd_prestart()
I believe this script worked by accident before.

PR:		279255
Approved by:	maintainer
Sponsored by:	Klara, Inc.
2024-08-22 11:28:26 +02:00

40 lines
762 B
Bash

#!/bin/sh
# PROVIDE: sssd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable `sssd':
#
# sssd_enable="YES"
#
# See sssd(8) for sssd_flags
#
. /etc/rc.subr
name=sssd
rcvar=sssd_enable
# read configuration and set defaults
load_rc_config "$name"
: ${sssd_enable:=NO}
: ${sssd_conf="%%PREFIX%%/etc/sssd/sssd.conf"}
: ${sssd_flags="-f -D"}
command="%%PREFIX%%/sbin/$name"
pidfile="/var/run/$name.pid"
required_files="${sssd_conf}"
start_precmd=sssd_prestart
sssd_prestart()
{
for i in db/sss/db db/sss/gpo_cache db/sss/keytabs db/sss/mc db/sss/pubconf/krb5.include.d/ db/sss/secrets log/sssd run/sss/pipes/private; do
if [ ! -d /var/${i} ]; then mkdir -p /var/${i}; fi
done
}
run_rc_command "$1"