-@@ -129,9 +129,9 @@ CGIUSER := nobody
- # Which command to use to check if the USER and GROUP to run Munin as, exists.
- # These will work on most modern OSes:
- #
--GETENT := $(shell which getent || which true 2>/dev/null)
--CHECKUSER := $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
--CHECKGROUP := $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
-+GETENT := /bin/true
-+CHECKUSER := /bin/true
-+CHECKGROUP := /bin/true
-
- # For OSX, comment out the previous two lines and comment in these
- #
-@@ -153,9 +153,9 @@ CHECKGROUP := $(shell $(GETENT) group $(
- #CHECKUSER := $(shell id $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
- #CHECKGROUP := $(shell grep ^$(GROUP): /etc/group >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
-
+@@ -125,38 +125,14 @@
+ # Default user to run the cgi as
+ CGIUSER := nobody
+
+-# Which command to use to check if the USER and GROUP to run Munin as, exists.
+-ifneq ($(shell which getent),)
+- # "getent" works on most modern OS
+- CHECKUSER_COMMAND := getent passwd $(USER)
+- CHECKGROUP_COMMAND := getent group $(GROUP)
+-else
+- ifeq ($(OSTYPE),darwin)
+- # This should work for OSX 10.5 (Leopard) or later
+- CHECKUSER_COMMAND := dscl . -read /Users/$(USER)
+- CHECKGROUP_COMMAND := dscl . -read /Groups/$(GROUP)
+- else
+- ifeq ($(OSTYPE),cygwin)
+- CHECKUSER_COMMAND := id $(USER)
+- CHECKGROUP_COMMAND := grep ^$(GROUP): /etc/group
+- else
+- ifeq ($(OSTYPE),hp-ux)
+- CHECKUSER_COMMAND := pwget -n $(USER)
+- CHECKGROUP_COMMAND := grget -n $(GROUP)
+- else
+- $(warning Missing test for user existence on this platform. Skipping this check and hoping for the best ...)
+- CHECKUSER_COMMAND := true
+- CHECKGROUP_COMMAND := true
+- endif
+- endif
+- endif
+-endif
+-CHECKUSER := $(shell $(CHECKUSER_COMMAND) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistent. Create the user and retry; exit 2"))
+-CHECKGROUP := $(shell $(CHECKGROUP_COMMAND) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistent. Create the group and retry; exit 2"))
+-