~evilham/cdist-evilham

d9f12945fc8660b14777098594d93b55eea1338a — Michelle 8 months ago 8a9cda3
Added custom commands for the run file

Added a parameter for adding custom code to the run file for runit.
M type/__evilham_single_binary_service/manifest => type/__evilham_single_binary_service/manifest +2 -0
@@ 49,6 49,7 @@ export require="${require} __directory${BIN_DIR}"
STATE="$(cat "${__object}/parameter/state")"
USER="$(cat "${__object}/parameter/user")"
GROUP="$(cat "${__object}/parameter/group" 2>/dev/null || true)"
CUSTOM_CODE="$(cat "${__object}/parameter/custom-code")"
if [ -z "${GROUP}" ]; then
	if [ "${USER}" != "root" ]; then
		GROUP="${USER}"


@@ 177,6 178,7 @@ exec 2>&1
export HOME="\$(getent passwd '${USER}' | cut -d: -f6)"
export USER="${USER}"
export GROUP="${GROUP}"
${CUSTOM_CODE}
exec chpst -u "${USER}:${GROUP}" ${SERVICE_EXEC}
EOF
)"

M type/__evilham_single_binary_service/parameter/optional => type/__evilham_single_binary_service/parameter/optional +1 -0
@@ 1,4 1,5 @@
config-file-source
custom-code
user
group
state