4

Ever since I've started using mosh, I'm getting way too many entries in my /var/log/wtmp file of last(1) on a Linux box.

cnst     pts/8        172.56.2x.yz via Mon May 19 08:19   still logged in
cnst     pts/8        mosh [50892]     Mon May 19 08:19 - 08:19  (00:00)
cnst     pts/8        172.56.2x.yz via Mon May 19 08:18 - 08:19  (00:01)
cnst     pts/8        mosh [50892]     Mon May 19 08:18 - 08:18  (00:00)
cnst     pts/8        172.56.2x.yz via Mon May 19 08:18 - 08:18  (00:00)
cnst     pts/8        mosh [50892]     Mon May 19 08:18 - 08:18  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 20:11 - 08:18  (12:06)
cnst     pts/8        mosh [50892]     Sun May 18 20:11 - 20:11  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 20:11 - 20:11  (00:00)
cnst     pts/8        mosh [50892]     Sun May 18 20:10 - 20:11  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:55 - 20:10  (00:15)
cnst     pts/8        mosh [50892]     Sun May 18 19:55 - 19:55  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:55 - 19:55  (00:00)
cnst     pts/8        mosh [50892]     Sun May 18 19:55 - 19:55  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:24 - 19:55  (00:30)
cnst     pts/8        mosh [50892]     Sun May 18 19:24 - 19:24  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:24 - 19:24  (00:00)
cnst     pts/8        mosh [50892]     Sun May 18 19:23 - 19:24  (00:00)

What's up with those 00 hours, 00 minutes, login entries?

Any way to adjust the parameters of mosh to not be so strict about reporting the very brief periods in the loss of connectivity?

Not really interested in having a couple of seconds of connectivity issues reported so loudly.

2

This was a known issue, as seen in mailing list discussion in 2012 shortly after the utmp support was added: Re: [mosh-users] logging to wtmp, where Kevin Winstein said

By default, mosh-server adds an entry to utmp (including the user's IP
address) whenever the user becomes active, and replaces it with a
different entry (with just the mosh PID) when they go inactive. This
can help you find abandoned mosh servers.


We don't have a configuration option to change this behavior, but if
you only want the initial utmp entry, you can comment out the source
code in mosh-server.cc that begins "/* update utmp if has been more
than 10 seconds since heard from client */" (near line 678).

That is, if you want to change the behavior, you have to modify the program. The program's changelog does not mention any improvement in this area.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.