Added setup config file for upstart session init
This commit is contained in:
parent
1ddda846d6
commit
24123ef45d
|
@ -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
|
Loading…
Reference in New Issue