[mosh-devel] libutempter debugging

Keith Winstein keithw at cs.stanford.edu
Sun Jan 20 19:04:42 EST 2019


Hello Adrian,

Mosh's use of utempter is pretty orthodox -- we call utempter_add_record()
and utempter_remove_record() in mosh-server.cc and that's about it. You can
see all the calls here:
https://github.com/mobile-shell/mosh/blob/master/src/frontend/mosh-server.cc

You might try writing a very simple .c program (separate from Mosh) that
links with utempter and tries to utempter_add_record(), and see if the
entry gets created. That will help narrow down if the problem is with Mosh
or with utempter.

One thing to note is that the utempter helper executable
(e.g. /usr/lib/x86_64-linux-gnu/utempter/utempter) is typically installed
setgid "utmp", and then /var/run/utmp is owned by group "utmp" and is g+w.
That's how libutempter can modify utmp -- by invoking the helper
executable, which has permission to write to /var/run/utmp because of the
setgid bit. If you installed utempter yourself, you might make sure the
helper executable has permission to write to utmp.

Best regards,
Keith

On Fri, Jan 18, 2019 at 2:57 AM Adrian Carpenter <adrian.carpenter at me.com>
wrote:

> Hi,
>
> I am currently working on getting the detached session notification
> working on a port of Mosh to the Synology NAS platform.
>
> I have built mosh with libutempter 1.1.6, it’s being linked in and being
> used.  However, I do not get the message about detached sessions.
>
> If I dump the the /var/run/utmp I can see that the mosh entries were not
> created, so I’m going to have to do some debugging.
>
> How would I go about debugging the mosh-server binary so that I can step
> through and see what is happening?  I’m not a unix developer by trade, so
> am not sure how I would achieve this given the client-server nature of mosh.
>
> Any ideas/tips/suggestions would be gratefully accepted.
>
> Many thanks
>
> Adrian
> _______________________________________________
> mosh-devel mailing list
> mosh-devel at mit.edu
> http://mailman.mit.edu/mailman/listinfo/mosh-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/mosh-devel/attachments/20190120/c4ce167a/attachment.html


More information about the mosh-devel mailing list