Bug 780643 - /dev/stderr no such device or address
Summary: /dev/stderr no such device or address
Status: RESOLVED DUPLICATE of bug 728774
Alias: None
Product: openSUSE 12.2
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: x86-64 openSUSE 12.2
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Dr. Werner Fink
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-15 23:43 UTC by Don Hughes
Modified: 2012-12-03 08:18 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Don Hughes 2012-09-15 23:43:17 UTC
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1

System upgraded from 11.4 to 12.2

For start up routines with errors I get the following message during boot:

... /etc/rc.status: line 57: /dev/stderr: No such device or address.



Reproducible: Always

Steps to Reproduce:
1. Boot system
2. Inspect log
3.
Comment 1 Sven Uebelacker 2012-11-05 18:18:51 UTC
Same here, as well with new installations of openSUSE 12.2.

happens at boot with ntpd:
ntp[1783]: /etc/rc.status: line 57: /dev/stderr: No such device or address

and sometimes while running (restarting npcd):
npcd[22338]: Shutting down npcd /etc/rc.status: line 57: /dev/stderr: No such device or address

seems that in the start environment /dev/stderr is not available (ntpd in chroot), maybe devtmpfs is not fully populated then.

Conflicting line 57 in /etc/rc.status of package aaa_base-12.2-2.11.1 is

start|stop|reload|restart|try-restart|force-reload|status) echo "redirecting to systemctl" >/dev/stderr ;;

by substituting ">/dev/stderr" with ">&2" everything is fine. See patch:


--- orig/etc/rc.status	2012-11-05 19:15:09.407475863 +0100
+++ fixed/etc/rc.status	2012-11-05 19:15:01.855257145 +0100
@@ -54,7 +54,7 @@ if test -z "$SYSTEMD_NO_WRAP" && /bin/mo
 	    ;;
 	esac
 	case "$1" in
-	    start|stop|reload|restart|try-restart|force-reload|status) echo "redirecting to systemctl" >/dev/stderr ;;
+	    start|stop|reload|restart|try-restart|force-reload|status) echo "redirecting to systemctl" >&2 ;;
 	    *) unset _rc_base ;;
 	esac
 	if test -n "$_rc_base" -a -x /bin/systemctl ; then
Comment 2 Sven Uebelacker 2012-11-15 15:39:47 UTC
and with mysql:

mysql[10912]: Shutting down service MySQL ..done
mysql[10985]: /etc/rc.status: line 57: /dev/stderr: No such device or address
mysql[10985]: Starting service MySQL ..done
Comment 3 Michal Marek 2012-11-23 09:59:42 UTC
/dev/stderr should be a symlink to /dev/fd/2, which in turn is a symlink to /proc/self/fd/2. Example:

$ namei -x /dev/stderr 
f: /dev/stderr
 D /
 D dev
 l stderr -> fd/2
   l fd -> /proc/self/fd
     D /
     D proc
     l self -> 23605
       d 23605
     d fd
   l 2 -> /dev/pts/0
     D /
     D dev
     D pts
     c 0

Please check how does /dev/stderr look like in your case.
Comment 4 Sven Uebelacker 2012-11-23 11:20:36 UTC
I modified the /etc/rc.status script by inserting your

/usr/bin/namei -x /dev/stderr > tmpfile

before the actual command of 

echo "redirecting to systemctl" >/dev/stderr


The output is:
"""
f: /dev/stderr
 D /
 D dev
 l stderr -> fd/2
   l fd -> /proc/self/fd
     D /
     D proc
     l self -> 32502
       d 32502
     d fd
   l 2 -> socket:[1004453]
socket:[1004453] - No such file or directory
"""

Hope this helps.
Comment 5 Michal Marek 2012-11-29 13:15:41 UTC
So /proc/self/fd/2 is a socket even in your shell? What shell is it? A tty login, ssh login, something else?
Comment 6 Sven Uebelacker 2012-11-29 13:40:09 UTC
The above output was generated while using a /bin/bash shell via ssh login on a virtual machine. To rule out an login shell/ssh error I collected more info while rebooting the machine including $SHELL and $TERM. The $1 of rc.status was in both cases "status":


Shutdown:
---- scope: status -- SHELL: /bin/bash -- TERM: dumb ----
f: /dev/stderr
 D /
 D dev
 l stderr -> fd/2
   l fd -> /proc/self/fd
     D /
     D proc
     l self -> 2594
       d 2594
     d fd
   l 2 -> socket:[12470]
socket:[12470] - No such file or directory


Boot:
---- scope: status -- SHELL: /bin/bash -- TERM: dumb ----
f: /dev/stderr
 D /
 D dev
 l stderr -> fd/2
   l fd -> /proc/self/fd
     D /
     D proc
     l self -> 1363
       d 1363
     d fd
   l 2 -> socket:[8960]
socket:[8960] - No such file or directory
Comment 7 Dr. Werner Fink 2012-12-03 08:18:39 UTC
This is a kernel bug as there is no such links below /proc/<pid>/fd for sockets pairs.  And as systemd uses socketpairs instead of pseudo ttys this cause the trouble.  A workaround would be that systemd would use pseudo ttys instead of sockets pairs for interactive jobs.  This could be done similar as startpar from SysVinit it does.

*** This bug has been marked as a duplicate of bug 728774 ***