diff --git a/installer/lib/airtime-session-init-setup.conf b/installer/lib/airtime-session-init-setup.conf new file mode 100755 index 000000000..a8305b182 --- /dev/null +++ b/installer/lib/airtime-session-init-setup.conf @@ -0,0 +1,22 @@ +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