大网数据广告活动
服务器运维问答

systemd : how to get the running target

· 52CE 我爱测

Command systemctl get-default returns user-defined.target . Then I use systemctl isolate multi-user.target to switch to multi-user.target . I can see that a bunch of services that shouldn't be running on user-defined.taret and sh…

问题原文

原帖链接 · iamauser · CC BY-SA 3.0

  • Command systemctl get-default returns user-defined.target.
  • Then I use systemctl isolate multi-user.target to switch to multi-user.target.
  • I can see that a bunch of services that shouldn't be running on user-defined.taret and should be running on multi-user are running, this implies I am on multi-user.target.
  • But, systemctl get-default always returns user-defined.target.

Question is, without looking and sorting through the services, how do I know that I am running on multi-user.target after using isolate ?

社区高分解答

原帖链接 · Amir · CC BY-SA 4.0

In systemd, there may be more than one active target at a time.

To inspect the list of all currently active targets:

systemctl list-units --type target --state active

To quickly find out whether a specific target (e.g. user-defined.target) is active or not:

systemctl is-active user-defined.target

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。