Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
65466f0702 | |||
db4eb9162b | |||
431f7e145e | |||
5b1dbee3ac | |||
6535b2b0e3 | |||
987c655fcc |
|
@ -5,3 +5,4 @@ A simple rc script to kickstart your system.
|
||||||
## depends
|
## depends
|
||||||
|
|
||||||
* Enabled sysrq or halt from suckless.org's ubase.
|
* Enabled sysrq or halt from suckless.org's ubase.
|
||||||
|
* /proc support.
|
||||||
|
|
5
rc.conf
5
rc.conf
|
@ -11,9 +11,12 @@ cfg_hostname='spark'
|
||||||
# Uncomment and change this to yours
|
# Uncomment and change this to yours
|
||||||
#cfg_timezone='Europe/Moscow'
|
#cfg_timezone='Europe/Moscow'
|
||||||
|
|
||||||
|
# Early fsck, if you don't have such a step in your initrd
|
||||||
|
cfg_early_fsck=1
|
||||||
|
|
||||||
# Services that start with @ are executed in parallel
|
# Services that start with @ are executed in parallel
|
||||||
cfg_services+=(
|
cfg_services+=(
|
||||||
'fsck' 'mount' 'sysctl' 'rsyslogd'
|
'mount' 'sysctl' 'rsyslogd'
|
||||||
'@lo.iface' '@scron' @agetty-tty{2..6}
|
'@lo.iface' '@scron' @agetty-tty{2..6}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
13
rc.in
13
rc.in
|
@ -118,6 +118,8 @@ rc.remount_root() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.boot() {
|
rc.boot() {
|
||||||
|
(( cfg_early_fsck )) && rc.fsck
|
||||||
|
|
||||||
rc.mount
|
rc.mount
|
||||||
rc.tmpfiles
|
rc.tmpfiles
|
||||||
rc.hostname
|
rc.hostname
|
||||||
|
@ -149,6 +151,7 @@ rc.halt() {
|
||||||
|
|
||||||
rc.sync() {
|
rc.sync() {
|
||||||
echo "Syncing disks."
|
echo "Syncing disks."
|
||||||
|
sync
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.shutdown() {
|
rc.shutdown() {
|
||||||
|
@ -180,11 +183,21 @@ rc.timezone() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc.fsck() {
|
||||||
|
declare root_rw=0
|
||||||
|
touch /rc-write-test && root_rw=1
|
||||||
|
(( root_rw )) && mount -o remount,ro /
|
||||||
|
fsck -A -C -p
|
||||||
|
(( root_rw )) && mount -o remount,rw /
|
||||||
|
}
|
||||||
|
|
||||||
rc.main() {
|
rc.main() {
|
||||||
source "@ETC@/rc.conf"
|
source "@ETC@/rc.conf"
|
||||||
|
|
||||||
# Default XDG_RUNTIME_DIR for all non-system users
|
# Default XDG_RUNTIME_DIR for all non-system users
|
||||||
# rtkit:x:133:133:RealtimeKit:/proc:/sbin/nologin
|
# rtkit:x:133:133:RealtimeKit:/proc:/sbin/nologin
|
||||||
|
# Also add one for root
|
||||||
|
cfg_tmpdirs+=( "/run/user/0:700:0:0" )
|
||||||
while IFS=':' read -r _ _ uid gid _; do
|
while IFS=':' read -r _ _ uid gid _; do
|
||||||
if (( uid >= 1000 )); then
|
if (( uid >= 1000 )); then
|
||||||
cfg_tmpdirs+=( "/run/user/$uid:700:$uid:$gid" )
|
cfg_tmpdirs+=( "/run/user/$uid:700:$uid:$gid" )
|
||||||
|
|
|
@ -39,7 +39,7 @@ get_procs_to_kill() {
|
||||||
|
|
||||||
pids_exist() {
|
pids_exist() {
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
if kill -0 "$i" 2>/dev/null; then
|
if [[ -d "/proc/$i" ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user