checkservices: Unable to parse pid file for [email protected]
When running checkservices, I am getting the following error:
$ sudo checkservices
:: Run pacdiff
:: Reload systemd
:: Services with broken maps files
Error:: Unable to parse pid file for [email protected].
Found: 0
:: Services missing on the system bus
Found: 0
:: List failed units
Am I doing something wrong? This seems like a common service to have.
checkservices started as a script for headless servers where people log in only via SSH. In case you log in via a graphical display manager, checkservices might detect that it needs to be restarted, which would terminate the entire session. Same for polkit.service, systemd-logind.service and maybe others (IIRC). The missing PID file for [email protected] just coincidentally avoids this.
@lahwaacz, thanks a lot for the clarification! Is there any sensible way to deal with this? I'm running Arch with Sway.
What do you think about asking for confirmation (Are you sure?) if it wants to run on a graphical arch?
I can create a PR for this.
I'd rather we have a list of ignored services and add things like [email protected] to it.
What do you think about asking for confirmation (Are you sure?) if it wants to run on a graphical arch?
checkservices already asks for confirmation before restarting services, but all services are grouped and restarted together...
I'd rather we have a list of ignored services and add things like [email protected] to it.
I'm not sure, aren't there other services which may break by restarting in a desktop environment?
What do you think about asking for confirmation (Are you sure?) if it wants to run on a graphical arch?
checkservicesalready asks for confirmation before restarting services, but all services are grouped and restarted together...
I was thinking of check the output of systemctl get-default and warn again if it's graphical.target.
I was thinking of check the output of
systemctl get-defaultand warn again if it'sgraphical.target.
You can have an active session, graphical or not, even with plain multi-user.target.
We are straying a bit from the issue. Keeping track of pid-less services is the goal, and this should be fairly simple to have as a filtered list in the code and omit them from the get_services code.
@aminvakil did you want to try implement this?
Does checking if systemctl show --property MainPID --value ${service} returns 0 or not suitable?
I don't think so?
λ ~ » systemctl show [email protected] | grep PID
GuessMainPID=yes
MainPID=404
ControlPID=0
ExecMainPID=404
λ ~ » systemctl show bolt.service | grep PID
GuessMainPID=yes
MainPID=1406
ControlPID=0
ExecMainPID=1406
$ sudo systemctl show [email protected] | grep PID
GuessMainPID=yes
MainPID=0
ControlPID=0
ExecMainPID=0
$ sudo systemctl show bolt.service | grep PID
GuessMainPID=yes
MainPID=0
ControlPID=0
ExecMainPID=0
Can this maybe somehow be related to linux-hardened?
If it helps, I'm not using linux-hardened, just bare bones linux.
If it helps, I'm not using
linux-hardened, just bare boneslinux.
Honestly I really don't think so, this is just a wild guess, and I meant returning 0 for MainPID when linux-hardened is used.
@aminvakil Obviously, if you don't have [email protected] active, systemctl shows its MainPID as 0.
@lahwaacz Sorry for late response, yes, it was not active.