Bug 2460

Summary: wall doesn\'t send msgs
Product: Sisyphus Reporter: imz <vanyaz>
Component: SysVinitAssignee: Dmitry V. Levin <ldv>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P1    
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
0002460-sysvinit-2.84-rh-alt.imz-wall-tty.patch
none
0002460-SysVinit-2.84-alt6.imz1.src.rpm none

Description imz 2003-04-01 23:36:13 MSD
Although mesg is y, neither the sender, not some other users working in different terminals (xterms and linux VCs) do not receive the messages, sent like this:

wall hi

No errors are reported.
---
mesg y
wall hi
---
$ rpm -qf $(which wall)
SysVinit-2.84-alt6
Comment 1 Dmitry V. Levin 2003-04-01 23:54:13 MSD
Does w(1) reports something about those users who do not receive messages from wall(1)?
If yes, are their \&quot;tty\&quot; parameters valid?
If yes, could you try to debug the change made in sysvinit-2.84-rh-alt-wall-tty.patch?
Comment 2 Dmitry V. Levin 2003-04-01 23:54:13 MSD
Does w(1) reports something about those users who do not receive messages from wall(1)?
If yes, are their \&quot;tty\&quot; parameters valid?
If yes, could you try to debug the change made in sysvinit-2.84-rh-alt-wall-tty.patch?
Comment 3 imz 2003-04-02 21:23:34 MSD
Today it works.

But that was not a joke. Yesterday `wall\' absolutly didn\'t work. It produced nothing.
Comment 4 imz 2003-04-02 21:23:34 MSD
Today it works.

But that was not a joke. Yesterday `wall\' absolutly didn\'t work. It produced nothing.
Comment 5 imz 2003-04-02 21:30:50 MSD
Here are the log scripts for these calls. Nothing interesting. All those that were made on 1st April did not work, those made on 2nd April did work.

# find /var/log -type f | xargs fgrep wall 
/var/log/auth/all:Apr  1 23:36:21 arrakis sudo:     ivan : TTY=pts/7 ; PWD=/data/ivan ; USER=root ; COMMAND=/usr/bin/wall hi
/var/log/auth/secure:Apr  1 23:36:21 arrakis sudo:     ivan : TTY=pts/7 ; PWD=/data/ivan ; USER=root ; COMMAND=/usr/bin/wall hi
/var/log/user/info:Apr  1 22:45:06 arrakis wall[3837]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/user/info:Apr  1 22:45:18 arrakis wall[3861]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/user/info:Apr  1 22:45:22 arrakis wall[3865]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 22:47:35 arrakis wall[3968]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:36:19 arrakis wall[5665]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:36:21 arrakis wall[5668]: wall: user root broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:36:29 arrakis wall[5704]: wall: user root broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:45:00 arrakis wall[6079]: wall: user ivan broadcasted 1 lines (9 chars)
/var/log/user/info:Apr  2 21:21:21 arrakis wall[4794]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  2 21:23:32 arrakis wall[4974]: wall: user ivan broadcasted 1 lines (5 chars)
/var/log/user/info:Apr  2 21:24:00 arrakis wall[4992]: wall: user ivan broadcasted 1 lines (7 chars)
/var/log/user/info:Apr  2 21:26:18 arrakis wall[5065]: wall: user z broadcasted 1 lines (6 chars)
/var/log/rpmpkgs:rwall-0.17-ipl7mdk.i586.rpm
/var/log/security/suid_group.yesterday:/usr/bin/wall
/var/log/security/suid_group.today:/usr/bin/wall
/var/log/syslog/messages:Apr  1 22:45:06 arrakis wall[3837]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/syslog/messages:Apr  1 22:45:18 arrakis wall[3861]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/syslog/messages:Apr  1 22:45:22 arrakis wall[3865]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 22:47:35 arrakis wall[3968]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:36:19 arrakis wall[5665]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:36:21 arrakis wall[5668]: wall: user root broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:36:29 arrakis wall[5704]: wall: user root broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:45:00 arrakis wall[6079]: wall: user ivan broadcasted 1 lines (9 chars)
/var/log/syslog/messages:Apr  2 21:21:21 arrakis wall[4794]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  2 21:23:32 arrakis wall[4974]: wall: user ivan broadcasted 1 lines (5 chars)
/var/log/syslog/messages:Apr  2 21:24:00 arrakis wall[4992]: wall: user ivan broadcasted 1 lines (7 chars)
/var/log/syslog/messages:Apr  2 21:26:18 arrakis wall[5065]: wall: user z broadcasted 1 lines (6 chars)
Comment 6 imz 2003-04-02 21:30:50 MSD
Here are the log scripts for these calls. Nothing interesting. All those that were made on 1st April did not work, those made on 2nd April did work.

# find /var/log -type f | xargs fgrep wall 
/var/log/auth/all:Apr  1 23:36:21 arrakis sudo:     ivan : TTY=pts/7 ; PWD=/data/ivan ; USER=root ; COMMAND=/usr/bin/wall hi
/var/log/auth/secure:Apr  1 23:36:21 arrakis sudo:     ivan : TTY=pts/7 ; PWD=/data/ivan ; USER=root ; COMMAND=/usr/bin/wall hi
/var/log/user/info:Apr  1 22:45:06 arrakis wall[3837]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/user/info:Apr  1 22:45:18 arrakis wall[3861]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/user/info:Apr  1 22:45:22 arrakis wall[3865]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 22:47:35 arrakis wall[3968]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:36:19 arrakis wall[5665]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:36:21 arrakis wall[5668]: wall: user root broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:36:29 arrakis wall[5704]: wall: user root broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  1 23:45:00 arrakis wall[6079]: wall: user ivan broadcasted 1 lines (9 chars)
/var/log/user/info:Apr  2 21:21:21 arrakis wall[4794]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/user/info:Apr  2 21:23:32 arrakis wall[4974]: wall: user ivan broadcasted 1 lines (5 chars)
/var/log/user/info:Apr  2 21:24:00 arrakis wall[4992]: wall: user ivan broadcasted 1 lines (7 chars)
/var/log/user/info:Apr  2 21:26:18 arrakis wall[5065]: wall: user z broadcasted 1 lines (6 chars)
/var/log/rpmpkgs:rwall-0.17-ipl7mdk.i586.rpm
/var/log/security/suid_group.yesterday:/usr/bin/wall
/var/log/security/suid_group.today:/usr/bin/wall
/var/log/syslog/messages:Apr  1 22:45:06 arrakis wall[3837]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/syslog/messages:Apr  1 22:45:18 arrakis wall[3861]: wall: user ivan broadcasted 1 lines (6 chars)
/var/log/syslog/messages:Apr  1 22:45:22 arrakis wall[3865]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 22:47:35 arrakis wall[3968]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:36:19 arrakis wall[5665]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:36:21 arrakis wall[5668]: wall: user root broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:36:29 arrakis wall[5704]: wall: user root broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  1 23:45:00 arrakis wall[6079]: wall: user ivan broadcasted 1 lines (9 chars)
/var/log/syslog/messages:Apr  2 21:21:21 arrakis wall[4794]: wall: user ivan broadcasted 1 lines (4 chars)
/var/log/syslog/messages:Apr  2 21:23:32 arrakis wall[4974]: wall: user ivan broadcasted 1 lines (5 chars)
/var/log/syslog/messages:Apr  2 21:24:00 arrakis wall[4992]: wall: user ivan broadcasted 1 lines (7 chars)
/var/log/syslog/messages:Apr  2 21:26:18 arrakis wall[5065]: wall: user z broadcasted 1 lines (6 chars)
Comment 7 imz 2003-04-03 20:28:19 MSD
It doesn\'t work again. :-(

`w\' shows those users, tty are valid. `cat\' to the corresponding tty-devices by the receiver works.

Will look at the patch.
Comment 8 imz 2003-04-03 20:28:19 MSD
It doesn\'t work again. :-(

`w\' shows those users, tty are valid. `cat\' to the corresponding tty-devices by the receiver works.

Will look at the patch.
Comment 9 imz 2003-04-03 22:02:13 MSD
It got an fd == 0, and thought this is a failure. With the modified attached patch it works. I wonder, why yesterday open() didn\'t return 0. Perhaps there are other places where 0 is considered to be a bad fd.

Used to work like this:

# strace -fF -e trace=open,close wall hi
open(\&quot;/etc/ld.so.preload\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/i686/libc.so.6\&quot;, O_RDONLY)   = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/etc/nsswitch.conf\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/libnss_files.so.2\&quot;, O_RDONLY) = 3
close(3)                                = 0
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 3
close(3)                                = 0
open(\&quot;/etc/localtime\&quot;, O_RDONLY)        = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/var/run/utmp\&quot;, O_RDWR)           = 3
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 4
close(4)                                = 0
close(0)                                = 0
open(\&quot;/dev/pts/0\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/2\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/4\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/5\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/6\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
close(3)                                = 0

Now:

# strace -fF -e trace=open,close wall hi
open(\&quot;/etc/ld.so.preload\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/i686/libc.so.6\&quot;, O_RDONLY)   = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/etc/nsswitch.conf\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/libnss_files.so.2\&quot;, O_RDONLY) = 3
close(3)                                = 0
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 3
close(3)                                = 0
open(\&quot;/etc/localtime\&quot;, O_RDONLY)        = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/var/run/utmp\&quot;, O_RDWR)           = 3
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 4
close(4)                                = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/0\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/2\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0

Broadcast message from root (pts/1) (Thu Apr  3 21:57:44 2003):

hi
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/4\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/5\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/6\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0

Broadcast message from root (pts/1) (Thu Apr  3 21:57:44 2003):

hi
close(0)                                = 0
close(3)                                = 0
Comment 10 imz 2003-04-03 22:02:13 MSD
It got an fd == 0, and thought this is a failure. With the modified attached patch it works. I wonder, why yesterday open() didn\'t return 0. Perhaps there are other places where 0 is considered to be a bad fd.

Used to work like this:

# strace -fF -e trace=open,close wall hi
open(\&quot;/etc/ld.so.preload\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/i686/libc.so.6\&quot;, O_RDONLY)   = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/etc/nsswitch.conf\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/libnss_files.so.2\&quot;, O_RDONLY) = 3
close(3)                                = 0
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 3
close(3)                                = 0
open(\&quot;/etc/localtime\&quot;, O_RDONLY)        = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/var/run/utmp\&quot;, O_RDWR)           = 3
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 4
close(4)                                = 0
close(0)                                = 0
open(\&quot;/dev/pts/0\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/2\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/4\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/5\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/6\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
close(0)                                = 0
close(3)                                = 0

Now:

# strace -fF -e trace=open,close wall hi
open(\&quot;/etc/ld.so.preload\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/i686/libc.so.6\&quot;, O_RDONLY)   = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/etc/nsswitch.conf\&quot;, O_RDONLY)    = 3
close(3)                                = 0
open(\&quot;/etc/ld.so.cache\&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(\&quot;/lib/libnss_files.so.2\&quot;, O_RDONLY) = 3
close(3)                                = 0
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 3
close(3)                                = 0
open(\&quot;/etc/localtime\&quot;, O_RDONLY)        = 3
close(3)                                = 0
close(3)                                = 0
open(\&quot;/var/run/utmp\&quot;, O_RDWR)           = 3
open(\&quot;/etc/passwd\&quot;, O_RDONLY)           = 4
close(4)                                = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/0\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/2\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0

Broadcast message from root (pts/1) (Thu Apr  3 21:57:44 2003):

hi
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/4\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/5\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/6\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0
[pid 19816] close(0)                    = 0
[pid 19816] open(\&quot;/dev/pts/1\&quot;, O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0

Broadcast message from root (pts/1) (Thu Apr  3 21:57:44 2003):

hi
close(0)                                = 0
close(3)                                = 0
Comment 11 Dmitry V. Levin 2003-04-03 22:07:56 MSD
My bad, it\'s native sysvinit bug which I had to fix myself.
Thanks a lot.
Comment 12 Dmitry V. Levin 2003-04-03 22:07:56 MSD
My bad, it\'s native sysvinit bug which I had to fix myself.
Thanks a lot.
Comment 13 imz 2003-04-03 22:09:51 MSD
Perhaps, it was a delibarate decision to take only fd &gt; 0. In order not write to the terminal of the sender. But as it can be seen from the strace logs, 0 is closed before something is written. Maybe this is the place where something should be fixed. (But the man-page says nothing about such a smart behaviour.)

If so, the statement

		if (fd &gt;= 0) close(fd);

in dowall.c will also break this smart behaviour.
Comment 14 imz 2003-04-03 22:09:51 MSD
Perhaps, it was a delibarate decision to take only fd &gt; 0. In order not write to the terminal of the sender. But as it can be seen from the strace logs, 0 is closed before something is written. Maybe this is the place where something should be fixed. (But the man-page says nothing about such a smart behaviour.)

If so, the statement

		if (fd &gt;= 0) close(fd);

in dowall.c will also break this smart behaviour.
Comment 15 Dmitry V. Levin 2003-04-04 16:18:44 MSD
There seems to be alarm handling error also.

Fixed in SysVinit-2.84-alt7; please check.
Comment 16 Dmitry V. Levin 2003-04-04 16:18:44 MSD
There seems to be alarm handling error also.

Fixed in SysVinit-2.84-alt7; please check.
Comment 17 imz 2003-04-13 12:50:01 MSD
Seems to work.

Somehow now it sends only 1 message to the terminal where `sudo su -\' is run; and used to send the message 2 times.
Comment 18 imz 2003-04-13 12:50:01 MSD
Seems to work.

Somehow now it sends only 1 message to the terminal where `sudo su -\' is run; and used to send the message 2 times.