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
Does w(1) reports something about those users who do not receive messages from wall(1)? If yes, are their \"tty\" parameters valid? If yes, could you try to debug the change made in sysvinit-2.84-rh-alt-wall-tty.patch?
Today it works. But that was not a joke. Yesterday `wall\' absolutly didn\'t work. It produced nothing.
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)
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.
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(\"/etc/ld.so.preload\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/ld.so.cache\", O_RDONLY) = 3 close(3) = 0 open(\"/lib/i686/libc.so.6\", O_RDONLY) = 3 close(3) = 0 close(3) = 0 open(\"/etc/nsswitch.conf\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/ld.so.cache\", O_RDONLY) = 3 close(3) = 0 open(\"/lib/libnss_files.so.2\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/passwd\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/localtime\", O_RDONLY) = 3 close(3) = 0 close(3) = 0 open(\"/var/run/utmp\", O_RDWR) = 3 open(\"/etc/passwd\", O_RDONLY) = 4 close(4) = 0 close(0) = 0 open(\"/dev/pts/0\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 close(0) = 0 open(\"/dev/pts/2\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 close(0) = 0 open(\"/dev/pts/1\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 close(0) = 0 open(\"/dev/pts/4\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 close(0) = 0 open(\"/dev/pts/5\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 close(0) = 0 open(\"/dev/pts/6\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 close(0) = 0 open(\"/dev/pts/1\", 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(\"/etc/ld.so.preload\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/ld.so.cache\", O_RDONLY) = 3 close(3) = 0 open(\"/lib/i686/libc.so.6\", O_RDONLY) = 3 close(3) = 0 close(3) = 0 open(\"/etc/nsswitch.conf\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/ld.so.cache\", O_RDONLY) = 3 close(3) = 0 open(\"/lib/libnss_files.so.2\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/passwd\", O_RDONLY) = 3 close(3) = 0 open(\"/etc/localtime\", O_RDONLY) = 3 close(3) = 0 close(3) = 0 open(\"/var/run/utmp\", O_RDWR) = 3 open(\"/etc/passwd\", O_RDONLY) = 4 close(4) = 0 [pid 19816] close(0) = 0 [pid 19816] open(\"/dev/pts/0\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 [pid 19816] close(0) = 0 [pid 19816] open(\"/dev/pts/2\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 [pid 19816] close(0) = 0 [pid 19816] open(\"/dev/pts/1\", 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(\"/dev/pts/4\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 [pid 19816] close(0) = 0 [pid 19816] open(\"/dev/pts/5\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 [pid 19816] close(0) = 0 [pid 19816] open(\"/dev/pts/6\", O_WRONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 0 [pid 19816] close(0) = 0 [pid 19816] open(\"/dev/pts/1\", 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
My bad, it\'s native sysvinit bug which I had to fix myself. Thanks a lot.
Perhaps, it was a delibarate decision to take only fd > 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 >= 0) close(fd); in dowall.c will also break this smart behaviour.
There seems to be alarm handling error also. Fixed in SysVinit-2.84-alt7; please check.
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.