From a3437967a2ae4730ba638cc80328055e9805e7c9 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 12 Apr 2018 06:40:39 +0200 Subject: Rely on PATH variable for running init programs Signed-off-by: David Oberhollenzer --- services/Makemodule.am | 5 ++++- services/agetty | 6 ++++++ services/agetty.in | 6 ------ services/hostname | 6 ++++++ services/hostname.in | 6 ------ services/hwclock | 6 ++++++ services/hwclock.in | 6 ------ services/loopback | 10 ++++++++++ services/loopback.in | 10 ---------- services/procfs.in | 2 +- services/reboot | 5 +++++ services/reboot.in | 5 ----- services/shutdown | 5 +++++ services/shutdown.in | 5 ----- services/sigterm.in | 2 +- services/sync | 6 ++++++ services/sync.in | 6 ------ services/sysctl | 6 ++++++ services/sysctl.in | 6 ------ services/sysfs.in | 2 +- services/tmpfs | 5 +++++ services/tmpfs.in | 5 ----- services/tmpfsrun | 11 +++++++++++ services/tmpfsrun.in | 11 ----------- services/tmpfsvar.in | 10 +++++----- 25 files changed, 78 insertions(+), 75 deletions(-) create mode 100644 services/agetty delete mode 100644 services/agetty.in create mode 100644 services/hostname delete mode 100644 services/hostname.in create mode 100644 services/hwclock delete mode 100644 services/hwclock.in create mode 100644 services/loopback delete mode 100644 services/loopback.in create mode 100644 services/reboot delete mode 100644 services/reboot.in create mode 100644 services/shutdown delete mode 100644 services/shutdown.in create mode 100644 services/sync delete mode 100644 services/sync.in create mode 100755 services/sysctl delete mode 100755 services/sysctl.in create mode 100644 services/tmpfs delete mode 100644 services/tmpfs.in create mode 100644 services/tmpfsrun delete mode 100644 services/tmpfsrun.in (limited to 'services') diff --git a/services/Makemodule.am b/services/Makemodule.am index 5f3c1bb..3c714a6 100644 --- a/services/Makemodule.am +++ b/services/Makemodule.am @@ -10,4 +10,7 @@ if PYGOSCFG init_DATA += services/rootusr services/tmpfsrun services/tmpfsvar endif -EXTRA_DIST += services/sysinit services/vfs +EXTRA_DIST += services/sysinit services/vfs services/agetty services/hostname +EXTRA_DIST += services/hwclock services/loopback services/reboot +EXTRA_DIST += services/shutdown services/sync services/sysctl services/tmpfs +EXTRA_DIST += services/tmpfsrun diff --git a/services/agetty b/services/agetty new file mode 100644 index 0000000..b4dc70d --- /dev/null +++ b/services/agetty @@ -0,0 +1,6 @@ +description agetty on %0 +exec agetty %0 linux +type respawn +target boot +after sysinit +tty "/dev/%0" diff --git a/services/agetty.in b/services/agetty.in deleted file mode 100644 index c4f78ad..0000000 --- a/services/agetty.in +++ /dev/null @@ -1,6 +0,0 @@ -description agetty on %0 -exec "@SBINPATH@/agetty" %0 linux -type respawn -target boot -after sysinit -tty "/dev/%0" diff --git a/services/hostname b/services/hostname new file mode 100644 index 0000000..d0daa23 --- /dev/null +++ b/services/hostname @@ -0,0 +1,6 @@ +description reload hostname +exec hostname --file /etc/hostname +type wait +target boot +before sysinit +after hwclock vfs diff --git a/services/hostname.in b/services/hostname.in deleted file mode 100644 index 678e07e..0000000 --- a/services/hostname.in +++ /dev/null @@ -1,6 +0,0 @@ -description reload hostname -exec "@BINPATH@/hostname" --file /etc/hostname -type wait -target boot -before sysinit -after hwclock vfs diff --git a/services/hwclock b/services/hwclock new file mode 100644 index 0000000..eeafe8b --- /dev/null +++ b/services/hwclock @@ -0,0 +1,6 @@ +description restore time from RTC +exec hwclock --hctosys --utc +type wait +target boot +before sysinit +after vfs diff --git a/services/hwclock.in b/services/hwclock.in deleted file mode 100644 index af3a4e4..0000000 --- a/services/hwclock.in +++ /dev/null @@ -1,6 +0,0 @@ -description restore time from RTC -exec "@SBINPATH@/hwclock" --hctosys --utc -type wait -target boot -before sysinit -after vfs diff --git a/services/loopback b/services/loopback new file mode 100644 index 0000000..5a77a6f --- /dev/null +++ b/services/loopback @@ -0,0 +1,10 @@ +description configure network loopback device +type wait +target boot +before sysinit +after hwclock hostname vfs + +exec { + ip addr add 127.0.0.1/8 dev lo brd + + ip link set lo up +} diff --git a/services/loopback.in b/services/loopback.in deleted file mode 100644 index 9e41ae1..0000000 --- a/services/loopback.in +++ /dev/null @@ -1,10 +0,0 @@ -description configure network loopback device -type wait -target boot -before sysinit -after hwclock hostname vfs - -exec { - "@SBINPATH@/ip" addr add 127.0.0.1/8 dev lo brd + - "@SBINPATH@/ip" link set lo up -} diff --git a/services/procfs.in b/services/procfs.in index 9124792..8c0743b 100644 --- a/services/procfs.in +++ b/services/procfs.in @@ -4,6 +4,6 @@ target boot before vfs exec { - "@SBINPATH@/mount" -t proc proc /proc + mount -t proc proc /proc "@SCRIPTDIR@/trymount.sh" /proc/sys/fs/binfmt_misc binfmt_misc nodev,noexec,nosuid } diff --git a/services/reboot b/services/reboot new file mode 100644 index 0000000..65a8eac --- /dev/null +++ b/services/reboot @@ -0,0 +1,5 @@ +description system reboot +exec shutdown -nrf +type wait +target reboot +after sync sigkill sigterm diff --git a/services/reboot.in b/services/reboot.in deleted file mode 100644 index da11e2a..0000000 --- a/services/reboot.in +++ /dev/null @@ -1,5 +0,0 @@ -description system reboot -exec "@SBINPATH@/shutdown" -nrf -type wait -target reboot -after sync sigkill sigterm diff --git a/services/shutdown b/services/shutdown new file mode 100644 index 0000000..679ffbd --- /dev/null +++ b/services/shutdown @@ -0,0 +1,5 @@ +description system shutdown +exec shutdown -npf +type wait +target shutdown +after sync sigkill sigterm diff --git a/services/shutdown.in b/services/shutdown.in deleted file mode 100644 index 6c28621..0000000 --- a/services/shutdown.in +++ /dev/null @@ -1,5 +0,0 @@ -description system shutdown -exec "@SBINPATH@/shutdown" -npf -type wait -target shutdown -after sync sigkill sigterm diff --git a/services/sigterm.in b/services/sigterm.in index cb408f2..7e77fba 100644 --- a/services/sigterm.in +++ b/services/sigterm.in @@ -5,5 +5,5 @@ before sigkill sync reboot shutdown exec { "@SCRIPTDIR@/killall5" 15 - "@BINPATH@/sleep" 5 + sleep 5 } diff --git a/services/sync b/services/sync new file mode 100644 index 0000000..d7217f9 --- /dev/null +++ b/services/sync @@ -0,0 +1,6 @@ +description sync +exec sync +type wait +target %0 +after sigkill sigterm +before reboot shutdown diff --git a/services/sync.in b/services/sync.in deleted file mode 100644 index 7f02287..0000000 --- a/services/sync.in +++ /dev/null @@ -1,6 +0,0 @@ -description sync -exec "@BINPATH@/sync" -type wait -target %0 -after sigkill sigterm -before reboot shutdown diff --git a/services/sysctl b/services/sysctl new file mode 100755 index 0000000..a5ee62b --- /dev/null +++ b/services/sysctl @@ -0,0 +1,6 @@ +description configure kernel paramters +exec sysctl --system +type wait +target boot +before sysinit +after hwclock hostname vfs diff --git a/services/sysctl.in b/services/sysctl.in deleted file mode 100755 index e2e6eaa..0000000 --- a/services/sysctl.in +++ /dev/null @@ -1,6 +0,0 @@ -description configure kernel paramters -exec "@SBINPATH@/sysctl" --system -type wait -target boot -before sysinit -after hwclock hostname vfs diff --git a/services/sysfs.in b/services/sysfs.in index 21938fb..8eebd0a 100644 --- a/services/sysfs.in +++ b/services/sysfs.in @@ -5,7 +5,7 @@ after procfs before vfs exec { - "@SBINPATH@/mount" -t sysfs sysfs /sys + mount -t sysfs sysfs /sys "@SCRIPTDIR@/trymount.sh" /sys/kernel/security securityfs nodev,noexec,nosuid "@SCRIPTDIR@/trymount.sh" /sys/kernel/config configfs nodev,noexec,nosuid "@SCRIPTDIR@/trymount.sh" /sys/fs/fuse/connections fusectl nodev,noexec,nosuid diff --git a/services/tmpfs b/services/tmpfs new file mode 100644 index 0000000..411a42b --- /dev/null +++ b/services/tmpfs @@ -0,0 +1,5 @@ +description "mount /tmp" +type wait +target boot +before vfs +exec mount -t tmpfs none /tmp diff --git a/services/tmpfs.in b/services/tmpfs.in deleted file mode 100644 index 1aa48cc..0000000 --- a/services/tmpfs.in +++ /dev/null @@ -1,5 +0,0 @@ -description "mount /tmp" -type wait -target boot -before vfs -exec "@SBINPATH@/mount" -t tmpfs none /tmp diff --git a/services/tmpfsrun b/services/tmpfsrun new file mode 100644 index 0000000..07dbd0a --- /dev/null +++ b/services/tmpfsrun @@ -0,0 +1,11 @@ +description "mount /run" +type wait +target boot +before vfs +after tmpfsvar +exec { + mount -t tmpfs none /run + mkdir /run/lock -m 0755 + ln -s /run /var/run + ln -s /run/lock /var/lock +} diff --git a/services/tmpfsrun.in b/services/tmpfsrun.in deleted file mode 100644 index c88a914..0000000 --- a/services/tmpfsrun.in +++ /dev/null @@ -1,11 +0,0 @@ -description "mount /run" -type wait -target boot -before vfs -after tmpfsvar -exec { - "@SBINPATH@/mount" -t tmpfs none /run - "@BINPATH@/mkdir" /run/lock -m 0755 - "@BINPATH@/ln" -s /run /var/run - "@BINPATH@/ln" -s /run/lock /var/lock -} diff --git a/services/tmpfsvar.in b/services/tmpfsvar.in index be7e563..5f45ecd 100644 --- a/services/tmpfsvar.in +++ b/services/tmpfsvar.in @@ -3,10 +3,10 @@ type wait target boot before vfs exec { - "@SBINPATH@/mount" -t tmpfs none /var - "@BINPATH@/mkdir" /var/log -m 0755 - "@BINPATH@/mkdir" /var/spool -m 0755 - "@BINPATH@/mkdir" /var/lib -m 0755 - "@BINPATH@/mkdir" /var/tmp -m 0755 + mount -t tmpfs none /var + mkdir /var/log -m 0755 + mkdir /var/spool -m 0755 + mkdir /var/lib -m 0755 + mkdir /var/tmp -m 0755 "@SCRIPTDIR@/overlay.sh" var_lib /var/lib } -- cgit v1.2.3