From 89b9fd96d17ed0ed0adc2ffc1345f660bea68f10 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 10 Feb 2023 13:00:48 +0000 Subject: New utmpd behaviour Signed-off-by: Laurent Bercot --- .../etc/s6-rc/source-base/btmpd/dependencies.d/init-utmp-early | 0 layout/rootfs/etc/s6-rc/source-base/btmpd/run | 2 +- .../etc/s6-rc/source-base/init-utmp-early/dependencies.d/00 | 0 layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down | 1 + layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type | 1 + layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up | 5 +++++ .../rootfs/etc/s6-rc/source-base/init-utmp/dependencies.d/utmpd | 0 layout/rootfs/etc/s6-rc/source-base/ok-local/contents.d/utmpd | 0 .../etc/s6-rc/source-base/utmpd/dependencies.d/init-utmp-early | 0 .../rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/mount-rwfs | 0 layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd | 1 + layout/rootfs/etc/s6-rc/source-base/utmpd/run | 8 ++++++++ layout/rootfs/etc/s6-rc/source-base/utmpd/type | 1 + .../etc/s6-rc/source-base/wtmpd/dependencies.d/init-utmp-early | 0 layout/rootfs/etc/s6-rc/source-base/wtmpd/run | 2 +- 15 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 layout/rootfs/etc/s6-rc/source-base/btmpd/dependencies.d/init-utmp-early create mode 100644 layout/rootfs/etc/s6-rc/source-base/init-utmp-early/dependencies.d/00 create mode 100644 layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down create mode 100644 layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type create mode 100644 layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up create mode 100644 layout/rootfs/etc/s6-rc/source-base/init-utmp/dependencies.d/utmpd create mode 100644 layout/rootfs/etc/s6-rc/source-base/ok-local/contents.d/utmpd create mode 100644 layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/init-utmp-early create mode 100644 layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/mount-rwfs create mode 100644 layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd create mode 100755 layout/rootfs/etc/s6-rc/source-base/utmpd/run create mode 100644 layout/rootfs/etc/s6-rc/source-base/utmpd/type create mode 100644 layout/rootfs/etc/s6-rc/source-base/wtmpd/dependencies.d/init-utmp-early (limited to 'layout/rootfs/etc/s6-rc') diff --git a/layout/rootfs/etc/s6-rc/source-base/btmpd/dependencies.d/init-utmp-early b/layout/rootfs/etc/s6-rc/source-base/btmpd/dependencies.d/init-utmp-early new file mode 100644 index 0000000..e69de29 diff --git a/layout/rootfs/etc/s6-rc/source-base/btmpd/run b/layout/rootfs/etc/s6-rc/source-base/btmpd/run index 4c7ffe6..97ab9d3 100755 --- a/layout/rootfs/etc/s6-rc/source-base/btmpd/run +++ b/layout/rootfs/etc/s6-rc/source-base/btmpd/run @@ -1,4 +1,4 @@ -#!/package/admin/execline/command/execlineb -S1 +#!/command/execlineb -S1 fdmove -c 2 1 s6-setuidgid utmp diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/dependencies.d/00 b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/dependencies.d/00 new file mode 100644 index 0000000..e69de29 diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/down @@ -0,0 +1 @@ + diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/type @@ -0,0 +1 @@ +oneshot diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up new file mode 100644 index 0000000..cb91c16 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/init-utmp-early/up @@ -0,0 +1,5 @@ +if { s6-mkdir -p -m 0755 /run/utmps } +if { s6-envuidgid utmp s6-chown -U -- /run/utmps } +s6-setuidgid utmp +redirfd -w 1 /run/utmps/utmp +exit 0 diff --git a/layout/rootfs/etc/s6-rc/source-base/init-utmp/dependencies.d/utmpd b/layout/rootfs/etc/s6-rc/source-base/init-utmp/dependencies.d/utmpd new file mode 100644 index 0000000..e69de29 diff --git a/layout/rootfs/etc/s6-rc/source-base/ok-local/contents.d/utmpd b/layout/rootfs/etc/s6-rc/source-base/ok-local/contents.d/utmpd new file mode 100644 index 0000000..e69de29 diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/init-utmp-early b/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/init-utmp-early new file mode 100644 index 0000000..e69de29 diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/mount-rwfs b/layout/rootfs/etc/s6-rc/source-base/utmpd/dependencies.d/mount-rwfs new file mode 100644 index 0000000..e69de29 diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd b/layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/notification-fd @@ -0,0 +1 @@ +3 diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/run b/layout/rootfs/etc/s6-rc/source-base/utmpd/run new file mode 100755 index 0000000..5c2d5d6 --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/run @@ -0,0 +1,8 @@ +#!/command/execlineb -S1 + +fdmove -c 2 1 +s6-setuidgid utmp +cd /run/utmps +fdmove 1 3 +s6-ipcserver -1 -c 1000 -- .utmpd-socket +utmps-utmpd diff --git a/layout/rootfs/etc/s6-rc/source-base/utmpd/type b/layout/rootfs/etc/s6-rc/source-base/utmpd/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/layout/rootfs/etc/s6-rc/source-base/utmpd/type @@ -0,0 +1 @@ +longrun diff --git a/layout/rootfs/etc/s6-rc/source-base/wtmpd/dependencies.d/init-utmp-early b/layout/rootfs/etc/s6-rc/source-base/wtmpd/dependencies.d/init-utmp-early new file mode 100644 index 0000000..e69de29 diff --git a/layout/rootfs/etc/s6-rc/source-base/wtmpd/run b/layout/rootfs/etc/s6-rc/source-base/wtmpd/run index a49e0de..eb66ed3 100755 --- a/layout/rootfs/etc/s6-rc/source-base/wtmpd/run +++ b/layout/rootfs/etc/s6-rc/source-base/wtmpd/run @@ -4,4 +4,4 @@ s6-setuidgid utmp cd /var/log/wtmpd fdmove 1 3 s6-ipcserver -1 -c 1000 -- /run/utmps/.wtmpd-socket -utmps-wtmpd +utmps-wtmpd wtmp -- cgit v1.2.3