#!/usr/bin/execlineb -P

# Debian ships /usr/lib/tmpfiles.d/puppetserver.conf with
#   d /var/run/puppetlabs/puppetserver 0755 puppet puppet -
# s6 has no tmpfiles.d handling, and run-script-daemon only creates
# /run/$(basename $DAEMON) = /run/puppetserver, which is not the path
# puppetserver uses. On puppet-1.crb2 the directory is missing altogether
# (dpkg -V puppetserver: "missing /var/run/puppetlabs"), which is exactly the
# kind of gap that only shows on a fresh installation.
if { mkdir -p /run/puppetlabs/puppetserver }
if { chown puppet:puppet /run/puppetlabs/puppetserver }
if { chmod 0755 /run/puppetlabs/puppetserver }
run-script-daemon puppetserver
