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

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://access.redhat.com/solutions/417363

 SOLUTION 已验证 - 已更新 2014年十月8日21:58 - 

English 

环境

  • 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:

Raw

systemctl list-units --type=target
  • Which actually doesn't even highlight the default.target. It would also be better than typing in:

Raw

]$ 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):

Raw

# 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:

Raw

systemctl show --default

or

Raw

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

决议

  • This is already possible, although not exactly as specified.

Raw

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值