From 4ba5ae5776c2e9ba4f297115c19923a928cf3e87 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 20 Nov 2017 14:51:36 +0000 Subject: Initial release / rename to utmps --- examples/openrc/utmpd | 8 ++++++++ examples/openrc/wtmpd | 8 ++++++++ examples/s6-rc/sutmp-prepare/dependencies | 1 + examples/s6-rc/sutmp-prepare/down | 1 + examples/s6-rc/sutmp-prepare/type | 1 + examples/s6-rc/sutmp-prepare/up | 2 ++ examples/s6-rc/utmpd-log/consumer-for | 1 + examples/s6-rc/utmpd-log/dependencies | 1 + examples/s6-rc/utmpd-log/run | 5 +++++ examples/s6-rc/utmpd-log/type | 1 + examples/s6-rc/utmpd/dependencies | 1 + examples/s6-rc/utmpd/notification-fd | 1 + examples/s6-rc/utmpd/pipeline-name | 1 + examples/s6-rc/utmpd/producer-for | 1 + examples/s6-rc/utmpd/run | 8 ++++++++ examples/s6-rc/utmpd/type | 1 + examples/s6-rc/wtmpd-log/consumer-for | 1 + examples/s6-rc/wtmpd-log/dependencies | 1 + examples/s6-rc/wtmpd-log/run | 5 +++++ examples/s6-rc/wtmpd-log/type | 1 + examples/s6-rc/wtmpd/dependencies | 1 + examples/s6-rc/wtmpd/notification-fd | 1 + examples/s6-rc/wtmpd/pipeline-name | 1 + examples/s6-rc/wtmpd/producer-for | 1 + examples/s6-rc/wtmpd/run | 8 ++++++++ examples/s6-rc/wtmpd/type | 1 + examples/s6/utmpd/log/run | 5 +++++ examples/s6/utmpd/notification-fd | 1 + examples/s6/utmpd/run | 11 +++++++++++ examples/s6/wtmpd/log/run | 5 +++++ examples/s6/wtmpd/notification-fd | 1 + examples/s6/wtmpd/run | 9 +++++++++ 32 files changed, 95 insertions(+) create mode 100755 examples/openrc/utmpd create mode 100755 examples/openrc/wtmpd create mode 100644 examples/s6-rc/sutmp-prepare/dependencies create mode 100644 examples/s6-rc/sutmp-prepare/down create mode 100644 examples/s6-rc/sutmp-prepare/type create mode 100644 examples/s6-rc/sutmp-prepare/up create mode 100644 examples/s6-rc/utmpd-log/consumer-for create mode 100644 examples/s6-rc/utmpd-log/dependencies create mode 100644 examples/s6-rc/utmpd-log/run create mode 100644 examples/s6-rc/utmpd-log/type create mode 100644 examples/s6-rc/utmpd/dependencies create mode 100644 examples/s6-rc/utmpd/notification-fd create mode 100644 examples/s6-rc/utmpd/pipeline-name create mode 100644 examples/s6-rc/utmpd/producer-for create mode 100644 examples/s6-rc/utmpd/run create mode 100644 examples/s6-rc/utmpd/type create mode 100644 examples/s6-rc/wtmpd-log/consumer-for create mode 100644 examples/s6-rc/wtmpd-log/dependencies create mode 100644 examples/s6-rc/wtmpd-log/run create mode 100644 examples/s6-rc/wtmpd-log/type create mode 100644 examples/s6-rc/wtmpd/dependencies create mode 100644 examples/s6-rc/wtmpd/notification-fd create mode 100644 examples/s6-rc/wtmpd/pipeline-name create mode 100644 examples/s6-rc/wtmpd/producer-for create mode 100644 examples/s6-rc/wtmpd/run create mode 100644 examples/s6-rc/wtmpd/type create mode 100755 examples/s6/utmpd/log/run create mode 100644 examples/s6/utmpd/notification-fd create mode 100755 examples/s6/utmpd/run create mode 100755 examples/s6/wtmpd/log/run create mode 100644 examples/s6/wtmpd/notification-fd create mode 100755 examples/s6/wtmpd/run (limited to 'examples') diff --git a/examples/openrc/utmpd b/examples/openrc/utmpd new file mode 100755 index 0000000..a091528 --- /dev/null +++ b/examples/openrc/utmpd @@ -0,0 +1,8 @@ +#!/sbin/openrc-run + +# Assumes the /run/utmps directory already exists and belongs to utmp + +name="utmpd" +command="s6-ipcserver -- /run/utmps/utmpd-socket utmps-utmpd" +pidfile="/run/utmps/utmpd.pid" +start_stop_daemon_args="-b -m -c utmp -d /run/utmps" diff --git a/examples/openrc/wtmpd b/examples/openrc/wtmpd new file mode 100755 index 0000000..5485a8d --- /dev/null +++ b/examples/openrc/wtmpd @@ -0,0 +1,8 @@ +#!/sbin/openrc-run + +# Assumes the /run/utmps directory already exists and belongs to utmp + +name="wtmpd" +command="s6-ipcserver -- /run/utmps/wtmpd-socket utmps-wtmpd" +pidfile="/run/utmps/wtmpd.pid" +start_stop_daemon_args="-b -m -c utmp -d /run/utmps" diff --git a/examples/s6-rc/sutmp-prepare/dependencies b/examples/s6-rc/sutmp-prepare/dependencies new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/examples/s6-rc/sutmp-prepare/dependencies @@ -0,0 +1 @@ + diff --git a/examples/s6-rc/sutmp-prepare/down b/examples/s6-rc/sutmp-prepare/down new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/examples/s6-rc/sutmp-prepare/down @@ -0,0 +1 @@ + diff --git a/examples/s6-rc/sutmp-prepare/type b/examples/s6-rc/sutmp-prepare/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/examples/s6-rc/sutmp-prepare/type @@ -0,0 +1 @@ +oneshot diff --git a/examples/s6-rc/sutmp-prepare/up b/examples/s6-rc/sutmp-prepare/up new file mode 100644 index 0000000..6091aad --- /dev/null +++ b/examples/s6-rc/sutmp-prepare/up @@ -0,0 +1,2 @@ +foreground { mkdir -p -m 0755 /run/utmps } +chown utmp:utmp /run/utmps diff --git a/examples/s6-rc/utmpd-log/consumer-for b/examples/s6-rc/utmpd-log/consumer-for new file mode 100644 index 0000000..fe07d03 --- /dev/null +++ b/examples/s6-rc/utmpd-log/consumer-for @@ -0,0 +1 @@ +utmpd diff --git a/examples/s6-rc/utmpd-log/dependencies b/examples/s6-rc/utmpd-log/dependencies new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/examples/s6-rc/utmpd-log/dependencies @@ -0,0 +1 @@ + diff --git a/examples/s6-rc/utmpd-log/run b/examples/s6-rc/utmpd-log/run new file mode 100644 index 0000000..586e53d --- /dev/null +++ b/examples/s6-rc/utmpd-log/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P + +s6-setuidgid utmplog +exec -c +s6-log t /var/log/utmpd diff --git a/examples/s6-rc/utmpd-log/type b/examples/s6-rc/utmpd-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/examples/s6-rc/utmpd-log/type @@ -0,0 +1 @@ +longrun diff --git a/examples/s6-rc/utmpd/dependencies b/examples/s6-rc/utmpd/dependencies new file mode 100644 index 0000000..6cfcf60 --- /dev/null +++ b/examples/s6-rc/utmpd/dependencies @@ -0,0 +1 @@ +utmps-prepare diff --git a/examples/s6-rc/utmpd/notification-fd b/examples/s6-rc/utmpd/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/examples/s6-rc/utmpd/notification-fd @@ -0,0 +1 @@ +3 diff --git a/examples/s6-rc/utmpd/pipeline-name b/examples/s6-rc/utmpd/pipeline-name new file mode 100644 index 0000000..d75e141 --- /dev/null +++ b/examples/s6-rc/utmpd/pipeline-name @@ -0,0 +1 @@ +utmpd-pipeline diff --git a/examples/s6-rc/utmpd/producer-for b/examples/s6-rc/utmpd/producer-for new file mode 100644 index 0000000..8ff8e12 --- /dev/null +++ b/examples/s6-rc/utmpd/producer-for @@ -0,0 +1 @@ +utmpd-log diff --git a/examples/s6-rc/utmpd/run b/examples/s6-rc/utmpd/run new file mode 100644 index 0000000..417ef5e --- /dev/null +++ b/examples/s6-rc/utmpd/run @@ -0,0 +1,8 @@ +#!/bin/execlineb -P + +fdmove -c 2 1 +s6-setuidgid utmp +cd /run/utmps +fdmove 1 3 +s6-ipcserver -1 -- /run/utmps/utmpd-socket +utmps-utmpd diff --git a/examples/s6-rc/utmpd/type b/examples/s6-rc/utmpd/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/examples/s6-rc/utmpd/type @@ -0,0 +1 @@ +longrun diff --git a/examples/s6-rc/wtmpd-log/consumer-for b/examples/s6-rc/wtmpd-log/consumer-for new file mode 100644 index 0000000..18e5a30 --- /dev/null +++ b/examples/s6-rc/wtmpd-log/consumer-for @@ -0,0 +1 @@ +wtmpd diff --git a/examples/s6-rc/wtmpd-log/dependencies b/examples/s6-rc/wtmpd-log/dependencies new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/examples/s6-rc/wtmpd-log/dependencies @@ -0,0 +1 @@ + diff --git a/examples/s6-rc/wtmpd-log/run b/examples/s6-rc/wtmpd-log/run new file mode 100644 index 0000000..715f41a --- /dev/null +++ b/examples/s6-rc/wtmpd-log/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P + +s6-setuidgid utmplog +exec -c +s6-log t /var/log/wtmpd diff --git a/examples/s6-rc/wtmpd-log/type b/examples/s6-rc/wtmpd-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/examples/s6-rc/wtmpd-log/type @@ -0,0 +1 @@ +longrun diff --git a/examples/s6-rc/wtmpd/dependencies b/examples/s6-rc/wtmpd/dependencies new file mode 100644 index 0000000..6cfcf60 --- /dev/null +++ b/examples/s6-rc/wtmpd/dependencies @@ -0,0 +1 @@ +utmps-prepare diff --git a/examples/s6-rc/wtmpd/notification-fd b/examples/s6-rc/wtmpd/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/examples/s6-rc/wtmpd/notification-fd @@ -0,0 +1 @@ +3 diff --git a/examples/s6-rc/wtmpd/pipeline-name b/examples/s6-rc/wtmpd/pipeline-name new file mode 100644 index 0000000..37edf1f --- /dev/null +++ b/examples/s6-rc/wtmpd/pipeline-name @@ -0,0 +1 @@ +wtmpd-pipeline diff --git a/examples/s6-rc/wtmpd/producer-for b/examples/s6-rc/wtmpd/producer-for new file mode 100644 index 0000000..4206ab1 --- /dev/null +++ b/examples/s6-rc/wtmpd/producer-for @@ -0,0 +1 @@ +wtmpd-log diff --git a/examples/s6-rc/wtmpd/run b/examples/s6-rc/wtmpd/run new file mode 100644 index 0000000..b9d9da3 --- /dev/null +++ b/examples/s6-rc/wtmpd/run @@ -0,0 +1,8 @@ +#!/bin/execlineb -P + +fdmove -c 2 1 +s6-setuidgid utmp +cd /run/utmps +fdmove 1 3 +s6-ipcserver -1 -- /run/utmps/wtmpd-socket +utmps-wtmpd diff --git a/examples/s6-rc/wtmpd/type b/examples/s6-rc/wtmpd/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/examples/s6-rc/wtmpd/type @@ -0,0 +1 @@ +longrun diff --git a/examples/s6/utmpd/log/run b/examples/s6/utmpd/log/run new file mode 100755 index 0000000..586e53d --- /dev/null +++ b/examples/s6/utmpd/log/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P + +s6-setuidgid utmplog +exec -c +s6-log t /var/log/utmpd diff --git a/examples/s6/utmpd/notification-fd b/examples/s6/utmpd/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/examples/s6/utmpd/notification-fd @@ -0,0 +1 @@ +3 diff --git a/examples/s6/utmpd/run b/examples/s6/utmpd/run new file mode 100755 index 0000000..238069b --- /dev/null +++ b/examples/s6/utmpd/run @@ -0,0 +1,11 @@ +#!/bin/execlineb -P + +fdmove -c 2 1 +foreground { mkdir -p -m 0755 /run/utmps } +foreground { chown utmp:utmp /run/utmps } +unexport ? +s6-setuidgid utmp +cd /run/utmps +fdmove 1 3 +s6-ipcserver -1 -- /run/utmps/utmpd-socket +utmps-utmpd diff --git a/examples/s6/wtmpd/log/run b/examples/s6/wtmpd/log/run new file mode 100755 index 0000000..5dd01cb --- /dev/null +++ b/examples/s6/wtmpd/log/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P + +s6-setuidgid utmplog +exec -c +s6-log t /var/log/utmps-wtmpd diff --git a/examples/s6/wtmpd/notification-fd b/examples/s6/wtmpd/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/examples/s6/wtmpd/notification-fd @@ -0,0 +1 @@ +3 diff --git a/examples/s6/wtmpd/run b/examples/s6/wtmpd/run new file mode 100755 index 0000000..9cc49b7 --- /dev/null +++ b/examples/s6/wtmpd/run @@ -0,0 +1,9 @@ +#!/bin/execlineb -P + +fdmove -c 2 1 +unexport ? +s6-setuidgid utmp +cd /run/utmps +fdmove 1 3 +s6-ipcserver -1 -- /run/utmps/wtmpd-socket +utmps-wtmpd -- cgit 1.4.1