Qubes-app-shutdown-idle not working with user-sysmaint-split

The qubes-app-shutdown-idle feature does not work in templates that use the user-sysmaint-split setup (e.g., Whonix Workstation and Kicksecure).

Is there a workaround for this, other than replacing user-sysmaint-split with qubes-core-agent-passwordless-root?

1 Like

I’ve modified the poweroff command in /lib/python3/dist-packages/qubesidle/idleness_monitor.py from subprocess.call(['sudo', 'poweroff']) to subprocess.call(['poweroff']).

Running the poweroff command directly in the user terminal successfully shuts down the VM, but the modified script does not work as expected.

Can anyone explain what I might be missing here?

1 Like

There should be more issues. The above works. You could try it by running python manually and run this inside it:

> python3
import subprocess
subprocess.call(["poweroff"])

I have tested the above right now on Kicksecure 17 template. It successfully shuts down the template.

1 Like
1 Like

@Atrate Thanks for sharing the issue. I just double checked and the solution suggested by you (and @marcos-morar ) simply works. I am not sure why it did not work for @marcos-morar earlier.

@Atrate are you willing to submit a patch? Just some try... except... to run power down with and without sudo.

The solution is working fine on kicksecure-17 but not on whonix-workstation. I don’t understand what’s the difference

^^

I appreciate if you could try changing

subprocess.call(['sudo', 'poweroff']).

with

subprocess.call(['systemctl', 'poweroff']).

In the whonix-workstation template and see if fixes the issue.

It is working for me personally, but my template is upgraded over and over in-place and may not represent the latest form of the stock template.

I upgraded the Whonix-Workstation base template using the Template Manager, and the user-sysmaint-split package was installed during the upgrade. After the upgrade, subprocess.call(["poweroff"]) worked fine. However, I cloned templates that were updated using Qubes Update Manager, and I manually installed user-sysmaint-split in those templates. In these cloned templates, subprocess.call(["poweroff"]) did not work, but subprocess.call(['systemctl', 'poweroff']) worked fine.

Thanks for your help, @alimirjamali.

1 Like