rootkiwi / an2linuxserver

Sync Android notifications encrypted to a Linux desktop
Other
401 stars 43 forks source link

When an2Linux is run as a service on the server, pairing hangs - overheating the server - because no prompt is displayed #52

Open LinuxOnTheDesktop opened 4 years ago

LinuxOnTheDesktop commented 4 years ago

I run an2linux as a user service. When I attempted to pair a new laptop with the phone app, the pairing hung. The cause is that, when run as a service, the server does not display any pairing prompt.

Moreover: while the phone was trying to setup the pairing, it left me unclear what it was doing. For, it displayed a hash and the 'save' and 'cancel' buttons, but the former button did nothing.

Also, while the pairing is hung (waiting for an answer to a prompt that never appears), an2linuxserver.py uses some 12% of my laptop's (the server's) CPU and keeps the CPU pegged to maximum frequency; as a result, the CPU read over 90 degrees C.

A further complication: manually running an2linuxserver.py, in order to try to determine what is happening, produces the cryptic error documented at #47 - because the service version of an2linux is occupying the required port.

My phone

Android Lollipop on a Moto G 1st Gen an2Linux 0.9.2(14)

My server/laptop

an2linux: latest OS: Linux Mint 19.2 Tina x86_64 Host: 20KHCTO1WW ThinkPad X1 Carbon 6th Kernel: 5.2.18-050218-generic Packages: 3153 (dpkg), 6 (flatpak), 4 (snap) Shell: bash 4.4.20 Resolution: 2560x1440 @ 60.01Hz DE: Cinnamon 4.2.4 WM: Mutter (Muffin) CPU: Intel i7-8550U (8) @ 4.000GHz GPU: Intel UHD Graphics 620 Memory: 3457MiB / 15931MiB

EDIT: The problem with the pairing seems to be what is reported at #47 , but/so what I mean to report here is: (1) the UI doesn't make it clear what is going on; (2) the program should not overheat the server. Possible solutions (best used together?) to 2: reduce CPU usage; build in a timeout.

rootkiwi commented 4 years ago

Thanks for reporting this. Yeah this is not good.

It's not possible to pair when running an2linux as a non-interactive service.

But it should be handled better than this.

LinuxOnTheDesktop commented 4 years ago

Here is what at present one needs to do if one is running an2linux as a user service and yet needs to re-pair. (At least if I recall the steps correctly. Note that making a mistake will spin the fans of the server device!)

On the server

systemctl --user stop an2linux.service
<full path to>/an2linuxserver.py

On the client Android device

Initiate pairing.

On the server again

Respond to the prompt.

On the Android device (again)

Select 'save'.

On the server (again)

systemctl --user start an2linux.service

rootkiwi commented 4 years ago

Indeed something needs to change