Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
65e0733db7 | |||
d9721360b1 | |||
![]() |
a3bcf72edb | ||
f3b0b94b3b | |||
![]() |
d100216548 | ||
953c999ccf | |||
253e6b1c5e |
19
1
19
1
@@ -5,20 +5,15 @@ PATH=/usr/bin:/usr/sbin
|
||||
|
||||
. /etc/runit/functions
|
||||
|
||||
if [ -x /usr/bin/openrc ]; then
|
||||
msg "Welcome to Artix Linux!"
|
||||
|
||||
# Start core services: we'll use OpenRC for this.
|
||||
msg "Initializing services with OpenRC..."
|
||||
|
||||
for runlevel in sysinit boot default; do
|
||||
openrc $runlevel || msg_error "Failed to start $runlevel runlevel"
|
||||
done
|
||||
else
|
||||
msg "Welcome to Artix Linux!"
|
||||
|
||||
[ -r /etc/runit/rc.conf ] && . /etc/runit/rc.conf
|
||||
|
||||
msg "Welcome to Artix Linux!"
|
||||
|
||||
if [ -x /usr/bin/openrc ] && [ "$SVMANAGER" = "openrc" ]; then
|
||||
# Start core services: we'll use OpenRC for this.
|
||||
msg "Initializing runlevel sysinit with OpenRC..."
|
||||
openrc sysinit || msg_error "Failed to start sysinit runlevel"
|
||||
else
|
||||
# Start core services: one-time system tasks.
|
||||
detect_virt
|
||||
for f in /etc/runit/core-services/*.sh; do
|
||||
|
7
2
7
2
@@ -13,6 +13,13 @@ done
|
||||
|
||||
[ -x /etc/runit/rc.local ] && /etc/runit/rc.local
|
||||
|
||||
# The reason that boot is not in stage 1 is because if something hangs
|
||||
# we can still listen for signals, however stage 1 does NOT accept signals
|
||||
if [ -x /usr/bin/openrc ] && [ "$SVMANAGER" = "openrc" ]; then
|
||||
openrc boot
|
||||
openrc default
|
||||
fi
|
||||
|
||||
runsvchdir "${runlevel}"
|
||||
mkdir -p /run/runit/runsvdir
|
||||
ln -s /etc/runit/runsvdir/current /run/runit/service
|
||||
|
20
Makefile
20
Makefile
@@ -6,14 +6,14 @@ all:
|
||||
$(CC) $(CFLAGS) pause.c -o pause $(LDFLAGS)
|
||||
|
||||
install:
|
||||
install -d ${DESTDIR}${PREFIX}/bin
|
||||
install -m755 halt ${DESTDIR}${PREFIX}/bin/halt-runit
|
||||
install -m755 pause ${DESTDIR}${PREFIX}/bin/pause-runit
|
||||
install -m755 shutdown ${DESTDIR}${PREFIX}/bin/shutdown-runit
|
||||
install -m755 modules-load ${DESTDIR}${PREFIX}/bin/modules-load
|
||||
install -m755 zzz ${DESTDIR}${PREFIX}/bin/zzz-runit
|
||||
ln -sf halt-runit ${DESTDIR}${PREFIX}/bin/poweroff-runit
|
||||
ln -sf halt-runit ${DESTDIR}${PREFIX}/bin/reboot-runit
|
||||
install -d ${DESTDIR}${PREFIX}/lib/runit-artix/bin
|
||||
install -m755 halt ${DESTDIR}${PREFIX}/lib/runit-artix/bin/halt
|
||||
install -m755 pause ${DESTDIR}${PREFIX}/lib/runit-artix/bin/pause
|
||||
install -m755 shutdown ${DESTDIR}${PREFIX}/lib/runit-artix/bin/shutdown
|
||||
install -m755 modules-load ${DESTDIR}${PREFIX}/lib/runit-artix/bin/modules-load
|
||||
install -m755 zzz ${DESTDIR}${PREFIX}/lib/runit-artix/bin/zzz
|
||||
ln -sf halt ${DESTDIR}${PREFIX}/lib/runit-artix/bin/poweroff
|
||||
ln -sf halt ${DESTDIR}${PREFIX}/lib/runit-artix/bin/reboot
|
||||
install -d ${DESTDIR}${PREFIX}/share/man/man1
|
||||
install -m644 pause.1 ${DESTDIR}${PREFIX}/share/man/man1
|
||||
install -d ${DESTDIR}${PREFIX}/share/man/man8
|
||||
@@ -35,8 +35,8 @@ install:
|
||||
install -m755 rc.shutdown ${DESTDIR}/etc/runit
|
||||
ln -sf /run/runit/reboot ${DESTDIR}/etc/runit/
|
||||
ln -sf /run/runit/stopit ${DESTDIR}/etc/runit/
|
||||
cp -aP runsvdir/* ${DESTDIR}/etc/runit/runsvdir/
|
||||
cp -aP services/* ${DESTDIR}/etc/runit/sv/
|
||||
cp -R --no-dereference --preserve=mode,links -v runsvdir/* ${DESTDIR}/etc/runit/runsvdir/
|
||||
cp -R --no-dereference --preserve=mode,links -v services/* ${DESTDIR}/etc/runit/sv/
|
||||
|
||||
clean:
|
||||
-rm -f halt pause
|
||||
|
15
README.md
15
README.md
@@ -4,21 +4,24 @@ This repository contains the runit init scripts for the Artix Linux
|
||||
distribution.
|
||||
|
||||
This work is based on Void Linux's
|
||||
[runit-void](https://github.com/voidlinux/void-runit). Patches to Void
|
||||
[void-runit](https://github.com/voidlinux/void-runit). Patches to Void
|
||||
Linux's repo will also be applied here.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- GNU coreutils
|
||||
- A POSIX shell
|
||||
- A POSIX awk
|
||||
- procps-ng (needs pkill -s0,1)
|
||||
- runit
|
||||
- opentmpfiles
|
||||
- opensysusers
|
||||
|
||||
### How to use it
|
||||
|
||||
To see enabled services for "current" runlevel:
|
||||
|
||||
$ ls -l /var/service
|
||||
$ ls -l /run/runit/service
|
||||
|
||||
To see available runlevels (default and single, which just runs sulogin):
|
||||
|
||||
@@ -26,21 +29,21 @@ To see available runlevels (default and single, which just runs sulogin):
|
||||
|
||||
To enable and start a service into the "current" runlevel:
|
||||
|
||||
# ln -s /etc/runit/sv/<service> /var/service
|
||||
# ln -s /etc/runit/sv/<service> /run/runit/service
|
||||
|
||||
To disable and remove a service:
|
||||
|
||||
# rm -f /var/service/<service>
|
||||
# rm -f /run/runit/service/<service>
|
||||
|
||||
To view status of all services for "current" runlevel:
|
||||
|
||||
# sv status /var/service/*
|
||||
# sv status /run/runit/service/*
|
||||
|
||||
Feel free to send patches and contribute with improvements!
|
||||
|
||||
## Copyright
|
||||
|
||||
runit-cromnix is in the public domain.
|
||||
runit-artix is in the public domain.
|
||||
|
||||
To the extent possible under law, the creator of this work has waived
|
||||
all copyright and related or neighboring rights to this work.
|
||||
|
@@ -2,5 +2,5 @@
|
||||
# Load them by looking at the output of `kmod static-nodes`.
|
||||
|
||||
for f in $(kmod static-nodes 2>/dev/null|awk '/Module/ {print $2}'); do
|
||||
modprobe -q $f 2>/dev/null
|
||||
modprobe -bq $f 2>/dev/null
|
||||
done
|
||||
|
@@ -10,6 +10,11 @@ else
|
||||
msg_warn "cannot find udevd!"
|
||||
fi
|
||||
|
||||
if [ -x /usr/bin/tmpfiles ]; then
|
||||
msg "Setting up tmpfiles.d entries for /dev..."
|
||||
tmpfiles --prefix=/dev --create --boot
|
||||
fi
|
||||
|
||||
if [ -n "${_udevd}" ]; then
|
||||
msg "Starting udev and waiting for devices to settle..."
|
||||
${_udevd} --daemon
|
||||
|
@@ -19,3 +19,13 @@ if [ -n "$TIMEZONE" ]; then
|
||||
msg "Setting up timezone to '${TIMEZONE}'..."
|
||||
ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
|
||||
fi
|
||||
|
||||
msg "Setting up sysusers.d entries..."
|
||||
if [ -x /usr/bin/sysusers ]; then
|
||||
sysusers
|
||||
fi
|
||||
|
||||
msg "Setting up tmpfiles.d entries..."
|
||||
if [ -x /usr/bin/tmpfiles ]; then
|
||||
tmpfiles --exclude-prefix=/dev --create --remove --boot
|
||||
fi
|
||||
|
@@ -3,10 +3,10 @@
|
||||
if [ -x /sbin/sysctl -o -x /bin/sysctl ]; then
|
||||
msg "Loading sysctl(8) settings..."
|
||||
for i in /run/sysctl.d/*.conf \
|
||||
/etc/sysctl.d/*.conf \
|
||||
/usr/local/lib/sysctl.d/*.conf \
|
||||
/usr/lib/sysctl.d/*.conf \
|
||||
/etc/sysctl.conf; do
|
||||
/etc/sysctl.conf \
|
||||
/etc/sysctl.d/*.conf; do
|
||||
|
||||
if [ -e "$i" ]; then
|
||||
printf '* Applying %s ...\n' "$i"
|
||||
|
@@ -7,5 +7,6 @@ fi
|
||||
if [ ! -e /var/log/btmp ]; then
|
||||
install -m0600 -o root -g utmp /dev/null /var/log/btmp
|
||||
fi
|
||||
install -dm1777 /tmp/.X11-unix /tmp/.ICE-unix
|
||||
rm -rf /tmp
|
||||
install -dm1777 /tmp /tmp/.X11-unix /tmp/.ICE-unix
|
||||
rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot
|
||||
|
Reference in New Issue
Block a user