wall

25 views
Skip to first unread message

Aryeh Leib Taurog

unread,
Jul 3, 2014, 7:26:51 AM7/3/14
to terminat...@googlegroups.com
I just noticed that messages broadcast with wall don't appear on my
terminator sessions. mesg is y. The messages come through on xterm
and gnome terminal.

Any idea why this is? Is there any way to get these messages?

I'm using debian 7.5

Regards,
Aryeh Leib Taurog

Martin Dorey

unread,
Jul 3, 2014, 9:41:55 PM7/3/14
to terminator-users
Wow, I remember wall, from back when I was in short trousers.  A look at the source for write(1) sent me to man utmp, which teacheth:

       xterm(1)  and  other  terminal emulators directly create a USER_PROCESS record and generate the ut_id by using
       the string that suffix part of the terminal name (the characters  following  /dev/[pt]ty).   If  they  find  a
       DEAD_PROCESS  for this ID, they recycle it, otherwise they create a new entry.  If they can, they will mark it
       as DEAD_PROCESS on exiting and it is advised that they null ut_line, ut_time, ut_user, and ut_host as well.

pututxline looks to be the call we should make.

...

But of course it's more complicated than that, so I've committed something only half-baked:

native/all/pty/terminator_terminal_PtyProcess.cpp: 
src/terminator/terminal/PtyProcess.java: Code to register the starting of a terminal, and its demise, with the utmpx facility, for wall(1), write(1) etc, at the suggestion of Aryeh Leib Taurog.  This will probably erect a portability obstacle and will cause log spam because it doesn't work out of the box even for me on Linux.  A regular user doesn't seem to have write permission to /var/run/utmp.  sudo adduser <user> utmp works.  Running terminator as root works.  Neither of these seem like they're likely to be good ideas.  How do other programs do this?  xterm seems to use a setgid root utempter executable from a libutempter0 package.  gnome-terminal doesn't directly do that but maybe it asks DBus or some such.





--
You received this message because you are subscribed to the Google Groups "terminator-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terminator-use...@googlegroups.com.
To post to this group, send email to terminat...@googlegroups.com.
Visit this group at http://groups.google.com/group/terminator-users.
For more options, visit https://groups.google.com/d/optout.

Elliott Hughes

unread,
Jul 4, 2014, 12:40:07 PM7/4/14
to terminat...@googlegroups.com
why not add a dependency on libutempter0 and shell out? if you're
worried about the cost for those who don't care, you could always add
an option and default it to off. doesn't gnome-terminal have such an
option?
--
Elliott Hughes - http://www.jessies.org/~enh/

Martin Dorey

unread,
Jul 4, 2014, 12:52:24 PM7/4/14
to terminator-users
Mainly because I ran out of time. I only discovered utempter once I'd got the old skool code working for root. libutempter0's apis aren't entirely self-evident - the source is the documentation. We might have to call it with stdin connected to the slave, which is OK for startup but perhaps tricky for shutdown. I don't give a fig about the window opening performance. I'm more concerned about portability, even though I've probably borked that. The competition seem to try direct utmp access first, even on Linux. That might cover us on Cygwin and Solaris, although my use of the Posix utmpx variant perhaps means that nothing but Linux is shiny enough to compile anymore. And now I'm away for the long weekend...

Aryeh Leib Taurog

unread,
Jul 14, 2014, 5:58:19 AM7/14/14
to terminat...@googlegroups.com, marti...@gmail.com
Could this be accomplished more easily using an external utility?  Perhaps like this one? 
<http://git.suckless.org/utmp/>

mad

unread,
Sep 15, 2014, 1:44:47 AM9/15/14
to terminat...@googlegroups.com, marti...@gmail.com
> Could this be accomplished more easily using an external utility?

That's what utempter is.

> Perhaps like this one? <http://git.suckless.org/utmp/>

I'm sure that's a fine program, but utempter had the virtue of being packaged for Debian.

>> That might cover us on Cygwin

It did.

I realized that pulling the code I'd written out into an executable would probably be easy, and making it setuid root would probably be easy and that'd probably work on Linux, without my needing to rework the call to have stdin connected to the slave.  And so it, finally, came to pass.  It's quite likely I've broken building for other people or other platforms, but eg w(1) is now working with Terminator on Debian for me.
Reply all
Reply to author
Forward
0 new messages