linuxdeploy icon indicating copy to clipboard operation
linuxdeploy copied to clipboard

No network for non-root program when lock screen

Open fjh1997 opened this issue 5 years ago • 8 comments

I have a rooted xiaomi 10 pro phone, ,the network is unavailable for non-root users after screen locked for a while, only work for root users .I could login to linux container as a non-root user via ssh because sshd is run as root, but when I try to use a program to connect network as a non-root user eg: ping,at first it works ,but if I lock the screen for a while, it wouldn't work. It seems there are some limits for my background process at the screen lock state. I have triedusermod -a -G aid_inet,aid_net_raw usernameand the way described in #1092 ,but don't make it better.anyone could help?

fjh1997 avatar Dec 14 '20 12:12 fjh1997

Also,when I test network,it shows ping: sendmsg operation not permitted for non-root users,what happend?

fjh1997 avatar Dec 14 '20 12:12 fjh1997

finally I found a way, it is because of android doze mode.just type su in termux or telnet terminal in ld to get the equivalent of adb shell($ become #),and type command dumpsys deviceidle disable to disable doze mode. That works! and maybe is there a way to add the process runned by users created in chroot to the deviceidle white list to solve this?

fjh1997 avatar Dec 15 '20 05:12 fjh1997

though disabling doze mode is a solution, but I wish someone could make user all_a100 in the doze mode deviceidle whitelist. because make linuxdeploy app itself has a package name "ru.meefik.linuxdeploy" and a user name u0_a475, add it to deviceidle whitelist is easydumpsys deviceidle whitelist +ru.meefik.linuxdeploy. But what about users in the chmod env (eg: all_a100 in /data/user/0/ru.meefik.linuxdeploy/files/bin/ps or 60000 in /system/bin/ps for username android and 1022 for another user named papa, different ps has different username for same process )? how to add them in the whitelist? linuxdeploy app user: 截屏2020-12-15 下午9 39 57 user android for ps of busybox shows : 截屏2020-12-15 下午9 38 28 user android for ps in debian container shows: image user android for ps of /system/bin/ps shows: 截屏2020-12-15 下午10 51 01 another user papa for ps of busybox shows: 截屏2020-12-15 下午10 27 43

fjh1997 avatar Dec 15 '20 13:12 fjh1997

I have the same issue and I found that network also stops when power saver is enabled on my phone, whether locked or unlocked. Disabling power saver might help.

Naofal-Helal avatar Jan 17 '21 14:01 Naofal-Helal

Having same issue. Any permanent solution for this?

cargen123 avatar Dec 11 '21 06:12 cargen123

@HyzenB Thanks man, disabling power works for me.

ChaosJohn avatar Jun 21 '22 06:06 ChaosJohn

@HyzenB

I have the same issue and I found that network also stops when power saver is enabled on my phone, whether locked or unlocked. Disabling power saver might help.

What the HELL!!!!!

You solve my problem!!!

What a breaking discovery !!!!

junbao-zhou avatar Feb 20 '23 15:02 junbao-zhou

@HyzenB Amazing!Resolved!!!

lwmfjc avatar Nov 09 '23 09:11 lwmfjc