https://access.redhat.com/solutions/417363
SOLUTION 已验证 - 已更新 2014年十月8日21:58 -
环境
- Red Hat Enterprise Linux 7
问题
- 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
决议
- This is already possible, although not exactly as specified.
systemctl show --property Id default.target
- This request for enhancement is under consideration to be implemented in a future release of RHEL, please raise a support case if this functionality is important to you.