create the default XDG_RUNTIME dirs
This commit is contained in:
parent
79bccd989e
commit
90c8943782
11
rc.in
Executable file → Normal file
11
rc.in
Executable file → Normal file
|
@ -17,6 +17,14 @@ cfg_tmpdirs+=( '/run/lock' '/run/lock/lvm' '/run/lvm' '/run/user' )
|
|||
# And temporary files
|
||||
cfg_tmpfiles+=( '/run/utmp' )
|
||||
|
||||
# Default XDG_RUNTIME_DIR for all non-system users
|
||||
# rtkit:x:133:133:RealtimeKit:/proc:/sbin/nologin
|
||||
while IFS=':' _ _ uid gid _; do
|
||||
if (( uid >= 1000 )); then
|
||||
cfg_tmpdirs+=( "/run/user/$uid:750:$uid:$gid" )
|
||||
fi
|
||||
done < /etc/passwd
|
||||
|
||||
# Functions
|
||||
rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
|
||||
|
||||
|
@ -32,7 +40,8 @@ rc.motd() {
|
|||
|
||||
rc.tmpfiles() {
|
||||
printf '%s\n' "${cfg_tmpdirs[@]}" | while IFS=':' read dir perm own grp; do
|
||||
install -v -d -m "${perm:-755}" -o "${own:-root}" -g "${grp:-root}" "$dir" 2>/dev/null
|
||||
mkdir -pm "${perm:-755}" "$dir"
|
||||
chown -c "${own:-root}:${grp:-root}" "$dir"
|
||||
done
|
||||
|
||||
printf '%s\n' "${cfg_tmpfiles[@]}" | while IFS=':' read file perm own grp; do
|
||||
|
|
Loading…
Reference in New Issue
Block a user