skybert's Blog

skybert's Avatar Image
Coder of systems, lover of languages, follower of Christ. 台灣女婿
← All posts

Get the PID of a given systemd unit:

$ systemctl show --property MainPID --value $SERVICE my-foo-service

It’s nice and less error prone to a have a stable API for getting this rather than pgrep/grep/sed/awking it.


To like or reply, open original post on