Trying to operate a system service when systemd-manager-tui was started without sudo yields:
┌Error───────────────────────────────────────────────────────────────┐
│ ERROR │
│ │
│ You do not have the permission to do that. Try running the program │
│ with sudo. │
│ │
│ Press any key to dismiss │
│ │
│ │
└────────────────────────────────────────────────────────────────────┘
But when you do the same with systemctl it doesn't do that - it prompts you for a sudoer password.
Is it possible to implement that behavior here as well?
I've did some research (asked ChatGPT) and systemctl does that via PolKit. You are using zbus, and I found a crate that connects the two: https://crates.io/crates/zbus_polkit. Maybe you can utilize it here?
Trying to operate a system service when
systemd-manager-tuiwas started withoutsudoyields:But when you do the same with
systemctlit doesn't do that - it prompts you for a sudoer password.Is it possible to implement that behavior here as well?
I've did some research (asked ChatGPT) and
systemctldoes that via PolKit. You are using zbus, and I found a crate that connects the two: https://crates.io/crates/zbus_polkit. Maybe you can utilize it here?