about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2015-03-31 17:14:55 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2015-04-01 14:46:43 +0200
commit78decbdb515f78864ad8144779cd453caacd7e90 (patch)
tree8b3e86fc82c38f6673201f0eafc976f9401f4617
parent12c657aa09efeed53e54ecb8f3fbd40c46d32746 (diff)
downloadrunit-void-78decbdb515f78864ad8144779cd453caacd7e90.tar.gz
runit-void-78decbdb515f78864ad8144779cd453caacd7e90.tar.xz
runit-void-78decbdb515f78864ad8144779cd453caacd7e90.zip
services: Refactor agetty-tty? services
-rwxr-xr-xservices/agetty-generic/run7
-rw-r--r--services/agetty-tty1/conf7
l---------[-rwxr-xr-x]services/agetty-tty1/run12
l---------services/agetty-tty2/conf1
l---------services/agetty-tty2/run2
l---------services/agetty-tty3/conf1
l---------services/agetty-tty3/run2
l---------services/agetty-tty4/conf1
l---------services/agetty-tty4/run2
l---------services/agetty-tty5/conf1
l---------services/agetty-tty5/run2
l---------services/agetty-tty6/conf1
l---------services/agetty-tty6/run2
13 files changed, 24 insertions, 17 deletions
diff --git a/services/agetty-generic/run b/services/agetty-generic/run
index 9a34297..f6e625c 100755
--- a/services/agetty-generic/run
+++ b/services/agetty-generic/run
@@ -1,4 +1,7 @@
 #!/bin/sh
+
+[ -r conf ] && . conf
+
 tty=${PWD##*-}
 if [ -x /sbin/getty ]; then
 	# busybox
@@ -7,4 +10,6 @@ elif [ -x /sbin/agetty ]; then
 	# util-linux
 	GETTY=agetty
 fi
-exec setsid $GETTY $tty 38400 linux
+
+exec setsid ${GETTY}${GETTY_ARGS:+ $GETTY_ARGS} \
+	"${tty}" "${baud_rate}" "${term_name}"
diff --git a/services/agetty-tty1/conf b/services/agetty-tty1/conf
new file mode 100644
index 0000000..977d7ef
--- /dev/null
+++ b/services/agetty-tty1/conf
@@ -0,0 +1,7 @@
+if [ -x /sbin/getty ]; then
+	# util-linux specific settings
+	GETTY_ARGS="--no-clear"
+fi
+
+baud_rate=38400
+term_name=linux
diff --git a/services/agetty-tty1/run b/services/agetty-tty1/run
index dc01b10..26e72f0 100755..120000
--- a/services/agetty-tty1/run
+++ b/services/agetty-tty1/run
@@ -1,11 +1 @@
-#!/bin/sh
-tty=${PWD##*-}
-if [ -x /sbin/getty ]; then
-	# busybox
-	GETTY=getty
-elif [ -x /sbin/agetty ]; then
-	# util-linux
-	GETTY=agetty
-	GETTY_ARGS="--noclear"
-fi
-exec setsid $GETTY $GETTY_ARGS $tty 38400 linux
+../agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty2/conf b/services/agetty-tty2/conf
new file mode 120000
index 0000000..7c3c642
--- /dev/null
+++ b/services/agetty-tty2/conf
@@ -0,0 +1 @@
+../agetty-tty1/conf
\ No newline at end of file
diff --git a/services/agetty-tty2/run b/services/agetty-tty2/run
index 2ebc95f..26e72f0 120000
--- a/services/agetty-tty2/run
+++ b/services/agetty-tty2/run
@@ -1 +1 @@
-/etc/sv/agetty-generic/run
\ No newline at end of file
+../agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty3/conf b/services/agetty-tty3/conf
new file mode 120000
index 0000000..7c3c642
--- /dev/null
+++ b/services/agetty-tty3/conf
@@ -0,0 +1 @@
+../agetty-tty1/conf
\ No newline at end of file
diff --git a/services/agetty-tty3/run b/services/agetty-tty3/run
index 2ebc95f..26e72f0 120000
--- a/services/agetty-tty3/run
+++ b/services/agetty-tty3/run
@@ -1 +1 @@
-/etc/sv/agetty-generic/run
\ No newline at end of file
+../agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty4/conf b/services/agetty-tty4/conf
new file mode 120000
index 0000000..7c3c642
--- /dev/null
+++ b/services/agetty-tty4/conf
@@ -0,0 +1 @@
+../agetty-tty1/conf
\ No newline at end of file
diff --git a/services/agetty-tty4/run b/services/agetty-tty4/run
index 2ebc95f..26e72f0 120000
--- a/services/agetty-tty4/run
+++ b/services/agetty-tty4/run
@@ -1 +1 @@
-/etc/sv/agetty-generic/run
\ No newline at end of file
+../agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty5/conf b/services/agetty-tty5/conf
new file mode 120000
index 0000000..7c3c642
--- /dev/null
+++ b/services/agetty-tty5/conf
@@ -0,0 +1 @@
+../agetty-tty1/conf
\ No newline at end of file
diff --git a/services/agetty-tty5/run b/services/agetty-tty5/run
index 2ebc95f..26e72f0 120000
--- a/services/agetty-tty5/run
+++ b/services/agetty-tty5/run
@@ -1 +1 @@
-/etc/sv/agetty-generic/run
\ No newline at end of file
+../agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty6/conf b/services/agetty-tty6/conf
new file mode 120000
index 0000000..7c3c642
--- /dev/null
+++ b/services/agetty-tty6/conf
@@ -0,0 +1 @@
+../agetty-tty1/conf
\ No newline at end of file
diff --git a/services/agetty-tty6/run b/services/agetty-tty6/run
index 2ebc95f..26e72f0 120000
--- a/services/agetty-tty6/run
+++ b/services/agetty-tty6/run
@@ -1 +1 @@
-/etc/sv/agetty-generic/run
\ No newline at end of file
+../agetty-generic/run
\ No newline at end of file