aboutsummaryrefslogtreecommitdiff
path: root/rcynic/rules.darwin.mk
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-07-06 07:01:44 +0000
committerRob Austein <sra@hactrn.net>2013-07-06 07:01:44 +0000
commitbb9d8597dd2d2b2df1bdbe02c50352b92024bedb (patch)
tree2a5ac510a5ff7bf25f288505cc21ee6afcd52601 /rcynic/rules.darwin.mk
parent4073245905b3573f6868a2c25769daa49f37f97f (diff)
Switch rpki-rtr sockets directory from being owned by "nobody" to
being owned by another userid we invented, so kickme works right when not running --cronjob as root. See #557. May need more testing as I am committing this in haste at NRT RedRug and testing on VMs while in transit.... svn path=/trunk/; revision=5426
Diffstat (limited to 'rcynic/rules.darwin.mk')
-rw-r--r--rcynic/rules.darwin.mk35
1 files changed, 35 insertions, 0 deletions
diff --git a/rcynic/rules.darwin.mk b/rcynic/rules.darwin.mk
index 998b5f54..d37b0e75 100644
--- a/rcynic/rules.darwin.mk
+++ b/rcynic/rules.darwin.mk
@@ -36,6 +36,41 @@ install-user-and-group: .FORCE
echo "Please create it, then try again."; \
exit 1; \
fi
+ @if /usr/bin/dscl . -read "/Groups/${RPKIRTR_GROUP}" >/dev/null 2>&1; \
+ then \
+ echo "You already have a group \"${RPKIRTR_GROUP}\", so I will use it."; \
+ elif gid="$$(/usr/bin/dscl . -list /Groups PrimaryGroupID | /usr/bin/awk 'BEGIN {gid = 501} $$2 >= gid {gid = 1 + $$2} END {print gid}')" && \
+ /usr/bin/dscl . -create "/Groups/${RPKIRTR_GROUP}" && \
+ /usr/bin/dscl . -create "/Groups/${RPKIRTR_GROUP}" RealName "${RPKIRTR_GECOS}" && \
+ /usr/bin/dscl . -create "/Groups/${RPKIRTR_GROUP}" PrimaryGroupID "$$gid" && \
+ /usr/bin/dscl . -create "/Groups/${RPKIRTR_GROUP}" GeneratedUID "$$(/usr/bin/uuidgen)" && \
+ /usr/bin/dscl . -create "/Groups/${RPKIRTR_GROUP}" Password "*"; \
+ then \
+ echo "Added group \"${RPKIRTR_GROUP}\"."; \
+ else \
+ echo "Adding group \"${RPKIRTR_GROUP}\" failed..."; \
+ echo "Please create it, then try again."; \
+ exit 1; \
+ fi; \
+ if /usr/bin/dscl . -read "/Users/${RPKIRTR_USER}" >/dev/null 2>&1; \
+ then \
+ echo "You already have a user \"${RPKIRTR_USER}\", so I will use it."; \
+ elif uid="$$(/usr/bin/dscl . -list /Users UniqueID | /usr/bin/awk 'BEGIN {uid = 501} $$2 >= uid {uid = 1 + $$2} END {print uid}')" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" UserShell "/usr/bin/false" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" RealName "${RPKIRTR_GECOS}" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" UniqueID "$$uid" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" PrimaryGroupID "$$gid" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" NFSHomeDirectory "/var/empty" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" GeneratedUID "$$(/usr/bin/uuidgen)" && \
+ /usr/bin/dscl . -create "/Users/${RPKIRTR_USER}" Password "*"; \
+ then \
+ echo "Added user \"${RPKIRTR_USER}\"."; \
+ else \
+ echo "Adding user \"${RPKIRTR_USER}\" failed..."; \
+ echo "Please create it, then try again."; \
+ exit 1; \
+ fi
install-shared-libraries: .FORCE