From b02e98ad03bfdf37cb17b56034168d4ad8638823 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 7 Feb 2024 18:41:32 +0100 Subject: fix init system --- rootfs/etc/runit/1 | 20 ++++++++++++++++++++ rootfs/etc/runit/2 | 2 ++ rootfs/etc/runit/3 | 6 ++++++ 3 files changed, 28 insertions(+) create mode 100755 rootfs/etc/runit/1 create mode 100755 rootfs/etc/runit/2 create mode 100755 rootfs/etc/runit/3 (limited to 'rootfs/etc/runit') diff --git a/rootfs/etc/runit/1 b/rootfs/etc/runit/1 new file mode 100755 index 0000000..f693a41 --- /dev/null +++ b/rootfs/etc/runit/1 @@ -0,0 +1,20 @@ +#!/bin/sh +# mount all drives in /etc/fstab +mount -a + +# clear run folder +rm -rf /var/run +mkdir -p /var/run + +# update hostname +hostname -F /etc/hostname + +# up all network interfaces +ifup -a -f + +# start system log +syslogd + +# go to stage 2 (normally runit (/sbin/init) does this by itself, but this is +# using busybox's weird init system) +(setsid /etc/runit/2 1> /dev/null 2> /dev/null &) diff --git a/rootfs/etc/runit/2 b/rootfs/etc/runit/2 new file mode 100755 index 0000000..6a6d609 --- /dev/null +++ b/rootfs/etc/runit/2 @@ -0,0 +1,2 @@ +#!/bin/sh +runsvdir -P /var/service diff --git a/rootfs/etc/runit/3 b/rootfs/etc/runit/3 new file mode 100755 index 0000000..8a0018d --- /dev/null +++ b/rootfs/etc/runit/3 @@ -0,0 +1,6 @@ +#!/bin/sh +# disable all network interfaces +ifdown -a + +# unmount all drives +umount -a -r -- cgit v1.2.3