summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2024-02-08 23:22:18 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-02-08 23:22:18 +0100
commit786fc07a9f990224db98f40ca819c81ab4e59966 (patch)
treececb554285055ffd384ec3123948ad95dc4dfb24
parent94e60a1affaaa4d74fa66618ca56ef360228a22b (diff)
runsystem.hurd.sh: Refresh from runsystem.hurd.sh.in
-rw-r--r--daemons/runsystem.hurd.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/daemons/runsystem.hurd.sh b/daemons/runsystem.hurd.sh
index 54f427dc..261af1c2 100644
--- a/daemons/runsystem.hurd.sh
+++ b/daemons/runsystem.hurd.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# This program is run by /hurd/init at boot time after the essential
# servers are up, and is responsible for running the "userland" parts of a
@@ -17,7 +17,7 @@ export PATH
umask 022
# If we lose badly, try to exec each of these in turn.
-fallback_shells='/bin/sh /bin/bash /bin/csh /bin/ash /bin/shd'
+fallback_shells='/bin/bash /bin/sh /bin/dash /bin/csh /bin/ash /bin/shd'
# Shell used for normal single-user startup.
SHELL=/bin/sh
@@ -35,18 +35,18 @@ runttys_sigs='TERM INT HUP TSTP'
# If we get a SIGLOST, attempt to reopen the console in case
# our console ports were revoked. This lets us print messages.
-function reopen_console ()
+reopen_console ()
{
exec 1>/dev/console 2>&1 || exit 3
}
-trap 'reopen_console' SIGLOST
+trap 'reopen_console' 32 # SIGLOST = server died on GNU
# Call this when we are losing badly enough that we want to punt normal
# startup entirely. We exec a single-user shell, so we will not come back
# here. The only way to get to multi-user from that shell will be
# explicitly exec this script or something like that.
-function singleuser ()
+singleuser ()
{
test $# -eq 0 || echo "$0: $*"
for try in ${fallback_shells}; do
@@ -56,12 +56,14 @@ function singleuser ()
exit 127
}
+# Print a newline.
+echo
# See whether pflocal is set up already, and do so if not (install case)
#
# Normally this should be the case, but we better make sure since
# without the pflocal server, pipe(2) does not work.
-if ! test -e /servers/socket/1 ; then
+if ! test -c /servers/socket/1 && command -v settrans >/dev/null ; then
# The root filesystem should be read-only at this point.
if fsysopts / --update --writable ; then
settrans -c /servers/socket/1 /hurd/pflocal
@@ -84,8 +86,6 @@ fi
###
# Parse the multiboot command line. We only pay attention to -s and -f.
-# The first argument is the kernel file name; skip that.
-shift
flags=
while [ $# -gt 0 ]; do
arg="$1"
@@ -96,10 +96,10 @@ while [ $# -gt 0 ]; do
-*)
flags="${flags}${arg#-}"
;;
- 'single'|'emergency') # Linux compat
+ 'single')
flags="${flags}s"
;;
- 'fastboot')
+ 'fastboot'|'emergency')
flags="${flags}f"
;;
esac