Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
79bccd989e | |||
6d2a516b64 | |||
|
87de61f78c | ||
22bb388fdb | |||
8af7868947 |
23
rc.in
23
rc.in
@@ -14,6 +14,9 @@ cfg_mounts+=( 'shm:tmpfs:/dev/shm:defaults,mode=0777' )
|
|||||||
# Some temporary directories
|
# Some temporary directories
|
||||||
cfg_tmpdirs+=( '/run/lock' '/run/lock/lvm' '/run/lvm' '/run/user' )
|
cfg_tmpdirs+=( '/run/lock' '/run/lock/lvm' '/run/lvm' '/run/user' )
|
||||||
|
|
||||||
|
# And temporary files
|
||||||
|
cfg_tmpfiles+=( '/run/utmp' )
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
|
rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
|
||||||
|
|
||||||
@@ -27,8 +30,16 @@ rc.motd() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.tmpdirs() {
|
rc.tmpfiles() {
|
||||||
mkdir -p -m0755 "${cfg_tmpdirs[@]}"
|
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
|
||||||
|
done
|
||||||
|
|
||||||
|
printf '%s\n' "${cfg_tmpfiles[@]}" | while IFS=':' read file perm own grp; do
|
||||||
|
> "$file"
|
||||||
|
chmod -c "${perm:-644}" "$file"
|
||||||
|
chown -c "${own:-root}:${grp:-root}" "$file"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.mount_misc() {
|
rc.mount_misc() {
|
||||||
@@ -104,7 +115,7 @@ rc.stop_everything() {
|
|||||||
|
|
||||||
rc.unmount_everything() {
|
rc.unmount_everything() {
|
||||||
echo "Unmounting filesystems..."
|
echo "Unmounting filesystems..."
|
||||||
umount -a
|
umount -r -a
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.remount_root() {
|
rc.remount_root() {
|
||||||
@@ -114,7 +125,6 @@ rc.remount_root() {
|
|||||||
|
|
||||||
rc.boot() {
|
rc.boot() {
|
||||||
rc.mount_misc
|
rc.mount_misc
|
||||||
rc.tmpdirs
|
|
||||||
rc.tmpfiles
|
rc.tmpfiles
|
||||||
rc.hostname
|
rc.hostname
|
||||||
rc.timezone
|
rc.timezone
|
||||||
@@ -135,6 +145,7 @@ rc.halt() {
|
|||||||
rc.shutdown() {
|
rc.shutdown() {
|
||||||
rc.services_stop
|
rc.services_stop
|
||||||
rc.stop_everything
|
rc.stop_everything
|
||||||
|
sync
|
||||||
rc.unmount_everything
|
rc.unmount_everything
|
||||||
rc.remount_root
|
rc.remount_root
|
||||||
|
|
||||||
@@ -160,10 +171,6 @@ rc.timezone() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.tmpfiles() {
|
|
||||||
>/run/utmp
|
|
||||||
}
|
|
||||||
|
|
||||||
rc.main() {
|
rc.main() {
|
||||||
source "@ETC@/rc.conf"
|
source "@ETC@/rc.conf"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user