summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-11-20 14:51:36 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-11-20 14:51:36 +0000
commit4ba5ae5776c2e9ba4f297115c19923a928cf3e87 (patch)
tree5a67f39a64dc5df84fc20307aa95d7536890b8b5 /examples
downloadutmps-4ba5ae5776c2e9ba4f297115c19923a928cf3e87.tar.xz
Initial release / rename to utmps
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/openrc/utmpd8
-rwxr-xr-xexamples/openrc/wtmpd8
-rw-r--r--examples/s6-rc/sutmp-prepare/dependencies1
-rw-r--r--examples/s6-rc/sutmp-prepare/down1
-rw-r--r--examples/s6-rc/sutmp-prepare/type1
-rw-r--r--examples/s6-rc/sutmp-prepare/up2
-rw-r--r--examples/s6-rc/utmpd-log/consumer-for1
-rw-r--r--examples/s6-rc/utmpd-log/dependencies1
-rw-r--r--examples/s6-rc/utmpd-log/run5
-rw-r--r--examples/s6-rc/utmpd-log/type1
-rw-r--r--examples/s6-rc/utmpd/dependencies1
-rw-r--r--examples/s6-rc/utmpd/notification-fd1
-rw-r--r--examples/s6-rc/utmpd/pipeline-name1
-rw-r--r--examples/s6-rc/utmpd/producer-for1
-rw-r--r--examples/s6-rc/utmpd/run8
-rw-r--r--examples/s6-rc/utmpd/type1
-rw-r--r--examples/s6-rc/wtmpd-log/consumer-for1
-rw-r--r--examples/s6-rc/wtmpd-log/dependencies1
-rw-r--r--examples/s6-rc/wtmpd-log/run5
-rw-r--r--examples/s6-rc/wtmpd-log/type1
-rw-r--r--examples/s6-rc/wtmpd/dependencies1
-rw-r--r--examples/s6-rc/wtmpd/notification-fd1
-rw-r--r--examples/s6-rc/wtmpd/pipeline-name1
-rw-r--r--examples/s6-rc/wtmpd/producer-for1
-rw-r--r--examples/s6-rc/wtmpd/run8
-rw-r--r--examples/s6-rc/wtmpd/type1
-rwxr-xr-xexamples/s6/utmpd/log/run5
-rw-r--r--examples/s6/utmpd/notification-fd1
-rwxr-xr-xexamples/s6/utmpd/run11
-rwxr-xr-xexamples/s6/wtmpd/log/run5
-rw-r--r--examples/s6/wtmpd/notification-fd1
-rwxr-xr-xexamples/s6/wtmpd/run9
32 files changed, 95 insertions, 0 deletions
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