libera/#maemo/ Monday, 2021-10-04

MaxdamantusHmm.. Something I'm noticing first day of use.. Android seems to somehow freeze my non-root processes in Debian while the screen is locked, so `sleep 60` will wait indefinitely, and my ssh client always loses connection by the time I next look at it.01:36
MaxdamantusGuess it's part of some "wake lock" mechanism.. will neet to look into making my uids acquire it.01:42
bencohMaxdamantus: yeah, wakelock is the way to go in android, but you'll probably get awful battery time if you lock anytime you're ssh'ed10:00
bencohwell, unless you do it in a smart way, which might be possible (maybe)10:01
MaxdamantusYeah, it was the wake lock thing (which actually applies device-wide, so since I wasn't running anything that had acquired a wake lock, the entire device was sleeping). I noticed that Termux has a simple UI for acquiring a wake lock, so I had that on.10:12
MaxdamantusThough the connection was still dying for some reason after about 4 minutes.10:13
MaxdamantusI might just try running httptunnel or something, since I think that is able to reestablish a connection.10:14
Maxdamantusor could probably use mosh, but that seems yucky abstraction-wise.10:14
bencohMaxdamantus: assuming you fixed the wakelock issue (btw, it prevents entering suspend-to-mem), you might want to try using ServerAliveInterval to send keepalive packets10:25
MaxdamantusYeah, I tried that.10:26
bencohoh?10:26
bencohand?10:26
bencohI wonder if something (kernel / userland) kills usb after some time (either when seeing no traffic, but then keepalive should fix that, or when userspace assumes the phone is 'idling', but that sounds silly)10:27
MaxdamantusWith 60-second keepalives, the connection lasts about 3 minutes before a read timeout. With a 5-second keepalive, it lasts about the same amount of time, though in that case the client closed the connection after 3 unacknowledged keepalives.10:31
Maxdamantusand I don't want to waste power with 5-second keepalives anyway. Would prefer the httptunnel solution.10:32
MaxdamantusThe httptunnel solution would be nice for other reasons.10:32
Maxdamantuseg, switching between cellular/wifi, or changing IP addresses, other lacking connectivity scenarios.10:33
MaxdamantusI could probably get away with just using a really long timeout in httptunnel and not bothering with the wakelock thing, so it won't use any power until I unlock the screen, and then it will download all the terminal updates.10:34
bencohyeah10:35
bencohtbh you could raise your ServerAliveCountMax as well10:35
MaxdamantusMaybe for the 5-second thing, but I suspect it will time out the same way as with the 60-second keepalives.10:36
bencohhmm10:36
MaxdamantusIt's just that with the 5-second one, the client will close the connection itself after only 15 seconds of inactivity, instead of waiting for the kernel or whatever to decide that something's timed out.10:36
Maxdamantus(using the presumably default ServerAliveCountMax=3)10:37
bencohwhat kind of interface do you see on the host? usbnet?10:38
MaxdamantusThe host? You mean ssh server? It's just my home computer, openssh sshd.10:39
bencohI meant the computer connected to the phone, but I assumed it was usb10:39
bencohlooks like you're actually using a wireless connection :)10:40
MaxdamantusThere's no USB. No computer connected to the phone. ssh client is running in my debian environment on the phone.10:40
Maxdamantuscellular connection.10:40
bencohah10:40
bencohthe client sits on the phone, not the other way around; I got it all wrong :)10:40

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!