From b229a09f7a48c4c40306803e9101680c5eb1ed92 Mon Sep 17 00:00:00 2001 From: rlibby Date: Thu, 6 Feb 2020 08:32:30 +0000 Subject: [PATCH] auditd_stop: wait_for_pids instead of sleeping It's faster and more reliable to wait_for_pids than to sleep 1. cem@ suggested just to remove auditd_stop() and use the rc.subr default stop action (SIGTERM instead of audit -t), which has a built-in wait_for_pids. That may be a better solution. Discussed with: cem Reviewed by: asomers Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23223 --- libexec/rc/rc.d/auditd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/auditd b/libexec/rc/rc.d/auditd index 8e078ec4c856..637214282de0 100755 --- a/libexec/rc/rc.d/auditd +++ b/libexec/rc/rc.d/auditd @@ -26,7 +26,9 @@ auditd_stop() { /usr/sbin/audit -t - sleep 1 + if [ -n "$rc_pid" ]; then + wait_for_pids $rc_pid + fi } load_rc_config $name