start on runlevel [2345] stop on runlevel [!2345] task env user=WEB_USER export user script uid=$(getent passwd "$user"|cut -d: -f3) gid=$(getent passwd "$user"|cut -d: -f4) # Create directory that would normally be # created by PAM when a user logs in. export XDG_RUNTIME_DIR="/run/user/$uid" mkdir -p "$XDG_RUNTIME_DIR" chmod 0700 "$XDG_RUNTIME_DIR" chown "$uid:$gid" "$XDG_RUNTIME_DIR" start airtime-session-init user="$user" end script