elementary / elementary/triage
[systemd-inhibit] Session inhibitor is not being held
- Dominant language
- No language data
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Context
Currently ProtonVPN linux client does not remove kill-switch and ipv6 leak interfaces upon reboot/shut down. This impacts the UX in a negative way, since the next time the machine will boot up, the user will be without internet access and uncertain of what could have caused this.
To mitigate this issue, we're working on a solution which creates a systemd (under `~/.config/systemd/user`) inhibitor which delays the reboot/shut down process so that the interfaces can be correctly removed, improving UX after a reboot or shut down.
Additional context:
- Our client is tightly integrated with Network Manager
- Code is written in python
## What Happened
When pressing on `power button -> Shut Down... -> Restart`, instead for starting the shut down process, it instead locks the session, presenting the login window for around 10-15 seconds*, which only after the previously mentioned time has passed, it restarts. After restarting and logging in into the user, the interfaces are still there and our logs show that the inhibitor was not held (as there was no time for them to be removed).
*During this time I can login do everything else as nothing had happened, only to be abruptly interrupted for a restart some seconds later
The output `systemd-inhibit --list` shows that our inhibitor has been registered:
```
systemd-inhibit --list
WHO UID USER PID COMM WHAT WHY MODE
ProtonVPN 1000 alexandru 23438 python shutdown Remove VPN interfaces delay
```
**Curious fact**
This unexpected behaviour does not seem to be reproducible if I reboot from terminal with `systemctl reboot`, as the inhibitor seems to be held and the interfaces are removed after reboot/shut down
## Expected Behavior
The inhibitor should be held until the `fd` for the inhibitor is closed, thus allowing to remove interfaces before shut down.
## Steps to Reproduce
Since we're developing our client, we can't really provide the exact steps at this point, although I'll provide some points:
- A `.service` file is created under `~/.config/systemd/user/`
- `python3-dbus` is used to communicate to dbus and create a inhibitor with the following configurations:
- `"shutdown", "ProtonVPN", "Remove VPN interfaces", "delay"`
- Check `systemd-inhibit --list` to ensure that the inhibitor has been created
- Restart from power button
### Logs
[Link](https://gist.github.com/calexandru2018/6f35e21ecf6bff0179879e054fa472f6), but the most relevant part:
```
set 27 10:54:53 HP-ENVY-Laptop-13-ad0xx-e5520718 python3[2678]: protonvpn_nm_lib.exceptions.DeleteKillswitchError: Unable to delete pvpn-killswitch
set 27 10:54:54 HP-ENVY-Laptop-13-ad0xx-e5520718 lightdm[2762]: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
set 27 10:54:54 HP-ENVY-Laptop-13-ad0xx-e5520718 lightdm[2762]: PAM adding faulty module: pam_kwallet.so
set 27 10:54:54 HP-ENVY-Laptop-13-ad0xx-e5520718 lightdm[2762]: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory
set 27 10:54:54 HP-ENVY-Laptop-13-ad0xx-e5520718 lightdm[2762]: PAM adding faulty module: pam_kwallet5.so
```
## Platform Information
- Elementary OS 6 (Odin) - Non-beta
- Kernel 5.11.0-36-generic
- Laptop: HP-ENVY-Laptop-13-ad0xx-e5520718
Contributor guide
Assessment
This issue has not been assessed yet.