[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1108605: hurd: fails to setup console and stdin/out/err



Le 23/08/2025 à 12:37, Martin-Éric Racine a écrit :
ln: failed to access 'stdin/0': Not a directory
ln: failed to access 'stdout/1': Not a directory
ln: failed to access 'stderr/2': Not a directory

This is because

cmd ln -f -s fd/0 stdin

does not take care of the case when /dev/stdin already exist. This
doesn't have any consequence, but could be fixed by checking whether the
symlink already exists.

Still not fixed as of Hurd 1:0.9.git20250801-3.

Sure, it "just" needs somebody to take care of it.

"could" above doesn't mean that I plan to take the time to fix it.

Attached is a patch for this.

That patch merely skips the linking if the std devices exist under the
old structure. It doesn't update them to what the linking would
produce.

$ ls -al stdin stdout stderr
lrwxrwxrwx 1 root root 4 2025-05-01 21:11 stderr -> fd/2
lrwxrwxrwx 1 root root 4 2025-05-01 21:11 stdin -> fd/0
lrwxrwxrwx 1 root root 4 2025-05-01 21:11 stdout -> fd/1

It really should ship with a script to normalize this as needed.

I don't understand what is meant here.

It means that if the structure of std devices is not what's expected
nowadays, such as in the above case, one should be able to
dpkg-reconfigure or run a script to update it.

Ah, OK. Then isn't simply adding -T to ln enough?

Attached is an updated patch.

Cheers,

--
Stéphane
From 43bc9b8f4aaf540f83b998a715f5889160dae744 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Glondu?= <steph@glondu.net>
Date: Sat, 23 Aug 2025 10:42:51 +0100
Subject: [PATCH] Do not fail if std{in,out,err} exist in MAKEDEV (Closes:
 #1108605)

---
 sutils/MAKEDEV.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sutils/MAKEDEV.sh b/sutils/MAKEDEV.sh
index 637c156..c664259 100644
--- a/sutils/MAKEDEV.sh
+++ b/sutils/MAKEDEV.sh
@@ -149,9 +149,9 @@ mkdev() {
 	st $I root 666 c /hurd/magic tty;;
       fd)
 	st $I root 666 d /hurd/magic --directory fd
-	cmd ln -f -s fd/0 stdin
-	cmd ln -f -s fd/1 stdout
-	cmd ln -f -s fd/2 stderr
+	cmd ln -f -s -T fd/0 stdin
+	cmd ln -f -s -T fd/1 stdout
+	cmd ln -f -s -T fd/2 stderr
 	;;
       'time')
 	st $I root 644 c /hurd/storeio --no-cache time ;;
-- 
2.50.1


Reply to: