# mounted-varrun - Populate /var/run filesystem
#
# Populates the /var/run filesystem, creating the empty utmp file

description	"Populate /var/run filesystem"

start on mounted MOUNTPOINT=/var/run TYPE=tmpfs
env MOUNTPOINT=/var/run

task

script
    : > "${MOUNTPOINT}/utmp"
    chmod 664 "${MOUNTPOINT}/utmp"
    chgrp utmp "${MOUNTPOINT}/utmp"

    [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* "${MOUNTPOINT}" || true

    mkdir -p /var/run/sendsigs.omit.d
end script
