Compare commits
12 Commits
new-rc
...
20200905-2
Author | SHA1 | Date | |
---|---|---|---|
7aa0d2f443 | |||
bf99596e5e | |||
397b46ff3f | |||
ee63bf4a06 | |||
bcd456603b | |||
![]() |
c75de34303 | ||
![]() |
6453301c3b | ||
![]() |
454078d6a0 | ||
05801e2283 | |||
f84f50c4e9 | |||
10bdc1aa58 | |||
2b66059dbf |
7
Makefile
7
Makefile
@@ -26,7 +26,7 @@ STAGES = \
|
||||
script/3 \
|
||||
script/ctrlaltdel
|
||||
|
||||
RCLOCAL = script/rc.local script/rc.shutdown
|
||||
RCLOCAL = script/rc.local.start script/rc.shutdown.stop
|
||||
|
||||
AGETTY_CONSOLE = $(wildcard sv/agetty-console/*)
|
||||
AGETTY_CONSOLE_S = supervise.agetty-console
|
||||
@@ -91,6 +91,7 @@ EDIT = sed \
|
||||
-e "s|@SERVICEDIR[@]|$(SERVICEDIR)|g" \
|
||||
-e "s|@RUNSVDIR[@]|$(RUNSVDIR)|g" \
|
||||
-e "s|@RUNDIR[@]|$(RUNDIR)|g" \
|
||||
-e "s|@SYSCONFDIR[@]|$(SYSCONFDIR)|g" \
|
||||
-e "s|@RCLIBDIR[@]|$(RCLIBDIR)|g"
|
||||
|
||||
%: %.in Makefile
|
||||
@@ -117,8 +118,8 @@ install-runit:
|
||||
$(LN) $(RUNDIR)/reboot $(DESTDIR)$(RUNITDIR)/
|
||||
$(LN) $(RUNDIR)/stopit $(DESTDIR)$(RUNITDIR)/
|
||||
|
||||
install -d $(DESTDIR)$(RCDIR)
|
||||
install -m755 $(RCLOCAL) $(DESTDIR)$(RCDIR)
|
||||
install -d $(DESTDIR)$(SYSCONFDIR)/local.d
|
||||
install -m755 $(RCLOCAL) $(DESTDIR)$(SYSCONFDIR)/local.d
|
||||
|
||||
install -d $(DESTDIR)$(BINDIR)
|
||||
install -m755 $(BIN) $(DESTDIR)$(BINDIR)
|
||||
|
@@ -6,6 +6,7 @@ PATH=/usr/bin:/usr/sbin
|
||||
|
||||
run_sysinit
|
||||
|
||||
install -m100 /dev/null @RUNDIR@/stopit
|
||||
install -m000 /dev/null @RUNDIR@/stopit
|
||||
install -m000 /dev/null @RUNDIR@/reboot
|
||||
|
||||
status "Initialization complete"
|
||||
|
@@ -10,7 +10,11 @@ for arg in $(cat /proc/cmdline); do
|
||||
fi
|
||||
done
|
||||
|
||||
[ -x @RCDIR@/rc.local ] && @RCDIR@/rc.local
|
||||
# Hacky hacky OpenRC compatibility
|
||||
for script in @SYSCONFDIR@/local.d/*.start; do
|
||||
[ -x "$script" ] && "$script"
|
||||
done
|
||||
|
||||
runsvchdir "${runlevel}"
|
||||
|
||||
ln -s @RUNSVDIR@/current @SERVICEDIR@
|
||||
|
@@ -11,11 +11,10 @@ stat_busy "Exit services ..."
|
||||
sv exit @RUNDIR@/service/*
|
||||
stat_done
|
||||
|
||||
[ -x @RCDIR@/rc.shutdown ] && @RCDIR@/rc.shutdown
|
||||
|
||||
if [ -e @RUNDIR@/reboot ]; then
|
||||
chmod 100 @RUNDIR@/reboot
|
||||
fi
|
||||
# Hacky hacky OpenRC compatibility
|
||||
for script in @SYSCONFDIR@/local.d/*.stop; do
|
||||
[ -x "$script" ] && "$script"
|
||||
done
|
||||
|
||||
run_shutdown
|
||||
|
||||
|
@@ -3,8 +3,11 @@
|
||||
PATH=/usr/bin:/usr/sbin
|
||||
MSG="System is going down..."
|
||||
|
||||
# We check for this file after receiving a SIGCONT to move to stage3
|
||||
chmod 100 @RUNDIR@/stopit
|
||||
|
||||
# We check for this file in stage3 to halt or reboot
|
||||
touch @RUNDIR@/reboot
|
||||
chmod 100 @RUNDIR@/reboot
|
||||
|
||||
# Proceed with shutdown process
|
||||
echo "$MSG" | wall
|
||||
|
@@ -1,4 +0,0 @@
|
||||
# @RCDIR@/rc.local -- rc.local for Artix Linux
|
||||
#
|
||||
# Enter your custom commands here. It will be executed on stage 2
|
||||
# before running services.
|
13
script/rc.local.start.in
Normal file
13
script/rc.local.start.in
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -x @SYSCONFDIR@/rc.local ]; then
|
||||
cat > @SYSCONFDIR@/rc.local << EOF
|
||||
# @SYSCONFDIR@/rc.local -- rc.local for Artix Linux
|
||||
#
|
||||
# Enter your custom commands here. It will be executed on stage 2
|
||||
# before running services.
|
||||
EOF
|
||||
chmod +x @SYSCONFDIR@/rc.local
|
||||
fi
|
||||
|
||||
. @SYSCONFDIR@/rc.local
|
@@ -1,4 +0,0 @@
|
||||
# @RCDIR@/rc.shutdown -- rc.shutdown for Artix Linux
|
||||
#
|
||||
# Enter your custom commands here. It will be executed on stage 3
|
||||
# after stopping services.
|
13
script/rc.shutdown.stop.in
Normal file
13
script/rc.shutdown.stop.in
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! -x @SYSCONFDIR@/rc.shutdown ]; then
|
||||
cat > @SYSCONFDIR@/rc.shutdown << EOF
|
||||
# @SYSCONFDIR@/rc.shutdown -- rc.shutdown for Artix Linux
|
||||
#
|
||||
# Enter your custom commands here. It will be executed on stage 3
|
||||
# after stopping services.
|
||||
EOF
|
||||
chmod +x @SYSCONFDIR@/rc.shutdown
|
||||
fi
|
||||
|
||||
. @SYSCONFDIR@/rc.shutdown
|
Reference in New Issue
Block a user