systemctl show: Find the Exact Systemd Service Executable

Quick Linux Tip #121:

Question: Which exact binary does a systemd service execute?

Try: systemctl show nginx -p ExecStart --no-pager

Info: The systemctl show command displays unit properties, extracting exact binaries, arguments, and configuration file paths via specific property filters.

Examples:

  • $ systemctl show nginx --all  # Dump all available properties for the service unit
  • $ systemctl cat nginx  # Display the complete raw configuration file content
  • $ systemd-analyze verify /etc/systemd/system/*.service  # Validate syntax and errors in unit files

Note: Combine output with grep for quick extraction. systemctl cat provides a cleaner layout for reviewing raw unit configurations.




LinuxTeck.com
linuxteck:~$ systemctl show nginx -p ExecStart --no-pager
ExecStart={ path=/usr/sbin/nginx ; argv[]=/usr/sbin/nginx -g daemon on; master_process on; ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }

linuxteck:~$ systemctl show nginx -p FragmentPath,User,Group,WorkingDirectory --no-pager
FragmentPath=/lib/systemd/system/nginx.service
User=
Group=
WorkingDirectory=
linuxteck:~$

PREVIOUS ARTICLE Quick Linux Tip #120: Linux Find Rogue Network Connections: Identify and Stop Them
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.