fralik / Duorem

27 stars 8 forks source link

shutdown command from advanced details not recognised #32

Closed spicewiesel closed 1 year ago

spicewiesel commented 1 year ago

Hi there and thanks for this app, it's so useful for us as we use it to wake and suspend our home server which saves some energy.

Recently it stopped working and I saw that the app always tries to execute "sudo /usr/bin/shutdown -r now" allthough I set an other command in the advanced settings. After saving the device the advanced settings toggle is always back to "off" but when activated I can see my custom command. Would be great to have the app back! Thanks a lot.

fralik commented 1 year ago

Thanks for letting me know. I will try to find some time to look into it.

spicewiesel commented 1 year ago

would be super cool, thank you!

fralik commented 1 year ago

Unfortunately, I can't reproduce the problem. If you want, you can try out this build, it should show you the command that is being sent to the device.

Otherwise: what android version do you use?

spicewiesel commented 1 year ago

Thanks for the help!

I installed your debug apk and I still do not see the sent command in the app itself, but I see what's happening on my system after the duorem user is logged in via ssh:

duorem : command not allowed ; TTY=pts/1 ; PWD=/tmp ; USER=root ; COMMAND=/usr/bin/shutdown -r now

So the app executes the default value for "Shutdown command" which is sudo shutdown -h now although I configured sudo systemctl suspend (which is the only allowed sudo command for this user).

I am on Android 13.

fralik commented 1 year ago

Hm. Could it be that you are still running the other version? Just to be sure, I've prepared a new bundle, which:

I see this in the emulator (android 13): duorem

And in the auth.log on the target system:

<...> sudo: duorem : TTY=pts/4 ; PWD=/home/duorem ; USER=root ; COMMAND=/usr/bin/systemctl reboot
<...> sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
<...> sudo: pam_unix(sudo:session): session closed for user root
spicewiesel commented 1 year ago

Hi, that did the trick, but I don't know why :) I reinstalled the fdroid version afterwards and that one is working again, too. So maybe it was just some weird local stuff on my phone and I hope I did not use too much of your time. Thanks a lot!