# mounted-run - Populate and link to /run filesystem
#
# Populates the /run filesystem and adds compatibility links to it

description	"Populate and link to /run filesystem"

start on mounted MOUNTPOINT=/run TYPE=tmpfs

task

script
    : > "/run/utmp"
    chmod 664 "/run/utmp"
    chgrp utmp "/run/utmp"

    # compatibility; should go away soon
    [ -d /dev/.initramfs/varrun ] && cp -a /dev/.initramfs/varrun/* /run/ || true

    mkdir -p /run/sendsigs.omit.d

    # Background the initial motd seeding
    [ -d "/etc/update-motd.d" ] && run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic &
end script
