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
22172

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

#linux

To like or reply, open original post on Emacs.ch