4 Commits

Author SHA1 Message Date
fbt
431f7e145e wait what how
Signed-off-by: fbt <fbt@fleshless.org>
2017-07-15 16:56:06 +03:00
fbt
5b1dbee3ac Merge branch 'master' of builder:git/spark-rc 2017-01-03 22:45:28 +03:00
fbt
6535b2b0e3 add a rundir for root
Signed-off-by: fbt <fbt@fleshless.org>
2016-09-14 08:46:07 +03:00
fbt
987c655fcc Just use /proc to see if a process is running 2016-03-29 19:21:53 +03:00
3 changed files with 5 additions and 1 deletions

View File

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

3
rc.in
View File

@@ -149,6 +149,7 @@ rc.halt() {
rc.sync() { rc.sync() {
echo "Syncing disks." echo "Syncing disks."
sync
} }
rc.shutdown() { rc.shutdown() {
@@ -185,6 +186,8 @@ rc.main() {
# 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" )

View File

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