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.
博客围绕在Red Hat Enterprise Linux 7环境下,能否为systemctl添加--show-default选项以显示default.target设置值展开。提出该需求是为有简单命令显示默认目标,决议表明虽不完全按要求但已有可能实现,此增强请求正考虑在RHEL未来版本实现。

被折叠的 条评论
为什么被折叠?



