1 Commits

10 changed files with 25 additions and 29 deletions

View File

@@ -91,7 +91,6 @@ 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
@@ -118,8 +117,8 @@ install-runit:
$(LN) $(RUNDIR)/reboot $(DESTDIR)$(RUNITDIR)/
$(LN) $(RUNDIR)/stopit $(DESTDIR)$(RUNITDIR)/
install -d $(DESTDIR)$(SYSCONFDIR)
install -m755 $(RCLOCAL) $(DESTDIR)$(SYSCONFDIR)
install -d $(DESTDIR)$(RCDIR)
install -m755 $(RCLOCAL) $(DESTDIR)$(RCDIR)
install -d $(DESTDIR)$(BINDIR)
install -m755 $(BIN) $(DESTDIR)$(BINDIR)

View File

@@ -6,7 +6,6 @@ PATH=/usr/bin:/usr/sbin
run_sysinit
install -m000 /dev/null @RUNDIR@/stopit
install -m000 /dev/null @RUNDIR@/reboot
install -m100 /dev/null @RUNDIR@/stopit
status "Initialization complete"
msg_ok "Initialization complete"

View File

@@ -10,13 +10,7 @@ for arg in $(cat /proc/cmdline); do
fi
done
[ -x @SYSCONFDIR@/rc.local ] && @SYSCONFDIR@/rc.local
# OpenRC compatibility
for script in /etc/local.d/*.start; do
[ -x "$script" ] && "$script"
done
[ -x @RCDIR@/rc.local ] && @RCDIR@/rc.local
runsvchdir "${runlevel}"
ln -s @RUNSVDIR@/current @SERVICEDIR@

View File

@@ -4,19 +4,16 @@ PATH=/usr/bin:/usr/sbin
. @RCLIBDIR@/functions
stat_busy "Stop services ..."
msg "Stopping services"
sv force-stop @RUNDIR@/service/*
stat_done
stat_busy "Exit services ..."
msg "Exiting services"
sv exit @RUNDIR@/service/*
stat_done
# OpenRC compatibility
for script in /etc/local.d/*.stop; do
[ -x "$script" ] && "$script"
done
[ -x @RCDIR@/rc.shutdown ] && @RCDIR@/rc.shutdown
[ -x @SYSCONFDIR@/rc.shutdown ] && @SYSCONFDIR@/rc.shutdown
if [ -e @RUNDIR@/reboot ]; then
chmod 100 @RUNDIR@/reboot
fi
run_shutdown
@@ -24,4 +21,4 @@ if [ -e @RUNDIR@/reboot ]; then
[[ -x $(type -P kexec) ]] && kexec -e &>/dev/null
fi
status "Stage 3 completed."
msg_ok "Stage 3 completed."

View File

@@ -3,11 +3,8 @@
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
chmod 100 @RUNDIR@/reboot
touch @RUNDIR@/reboot
# Proceed with shutdown process
echo "$MSG" | wall

View File

@@ -1,4 +1,4 @@
# @SYSCONFDIR@/rc.local -- rc.local for Artix Linux
# @RCDIR@/rc.local -- rc.local for Artix Linux
#
# Enter your custom commands here. It will be executed on stage 2
# before running services.

View File

@@ -1,4 +1,4 @@
# @SYSCONFDIR@/rc.shutdown -- rc.shutdown for Artix Linux
# @RCDIR@/rc.shutdown -- rc.shutdown for Artix Linux
#
# Enter your custom commands here. It will be executed on stage 3
# after stopping services.

View File

@@ -0,0 +1,3 @@
This service is a one-time script to make sure enabled one-shot/rc
services in Artix can be run automatically on boot. For list of enabled
rc services, run "service list rc".

3
sv/artix-oneshot-rc/finish Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
. /usr/lib/rc/functions
stop_oneshot_services

4
sv/artix-oneshot-rc/run Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
. /usr/lib/rc/functions
run_oneshot_services
exec chpst -b artix-oneshot pause