Is there a RHEL 7 systemctl --show-default option?

Solution Verified - Updated -

Issue

  • Is it possible to get a --show-default option added to systemctl to show what the default.target is set to rather than typing in:
systemctl list-units --type=target
  • Which actually doesn't even highlight the default.target. It would also be better than typing in:
]$ ls -l /lib/systemd/system/default.target
lrwxrwxrwx. 1 root root 16 Apr 16 11:24 /lib/systemd/system/default.target -> graphical.target

Example usage of --show-default (i.e. default.target is set to multi-user.target):

# systemctl --show-default
multi-user.target
  • That syntax requires a couple of levels of processing down the line. What this request is for is a simple command to show the default target without too much thinking being involved. To that end, something like:
systemctl show --default

or

systemctl show --default-target (if that's more acceptable)
  • add --show-default option to systemd

Environment

  • Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content