summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2025-10-09 13:41:50 +0000
committerMark Johnston <markj@FreeBSD.org>2025-10-09 13:46:47 +0000
commit60334f077945aee154a20ac65076f2bfd69dac9e (patch)
treec14fd4c61b9ed3cb130b28ec7a72aba5eb1a6436
parentcad/opentimer: Update g20221116 => 2.1.0-20250707 (diff)
sysutils/amazon-ssm-agent: Use pw(8)'s new metalog feature
This allows the ssm-agent user to be created when installing as an unprivileged user. That is, if the package is installed with pkg(8)'s METALOG option set, the home directory for ssm-agent will be added to the metalog. PR: 290080 Approved by: cperciva (maintainer) Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc.
-rw-r--r--sysutils/amazon-ssm-agent/pkg-install6
1 files changed, 5 insertions, 1 deletions
diff --git a/sysutils/amazon-ssm-agent/pkg-install b/sysutils/amazon-ssm-agent/pkg-install
index f42d5b710f72..743ffdd91a85 100644
--- a/sysutils/amazon-ssm-agent/pkg-install
+++ b/sysutils/amazon-ssm-agent/pkg-install
@@ -2,5 +2,9 @@
if [ "$2" = "POST-INSTALL" ]; then
echo "Creating ssm-user for SSM Agent Sessions"
- pw -R ${PKG_ROOTDIR} useradd ssm-user -G wheel -m
+ if [ -n "${PKG_METALOG}" ] && \
+ pw useradd --help 2>&1 | grep -q -F -- '-M metalog'; then
+ METALOG="-M ${PKG_METALOG}"
+ fi
+ pw ${METALOG} -R ${PKG_ROOTDIR} useradd ssm-user -G wheel -m
fi