Added setup config file for upstart session init

This commit is contained in:
Duncan Sommerville 2015-01-09 11:21:44 -05:00
parent 1ddda846d6
commit 24123ef45d
1 changed files with 22 additions and 0 deletions

View File

@ -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