0
点赞
收藏
分享

微信扫一扫

CentOS/Rocky8中设置cockpit自启动

在系统中使用虚拟机,之前使用的时virt-manager,但红帽子的文档中说使用cockpit进行逐渐替代,因此个人也逐渐转移自己的使用方法。但是cockpit这个服务配置自启动时遇到了问题,使用'sudo systemctl enable cockpit'报错如下:

The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.

Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

根据提示服务的unit文件中'[Install]'单元部分找不到'WantedBy=, RequiredBy=, Also=, Alias='的相关设置,所以不能使用systemctl来配置自启动,修改文件'/usr/lib/systemd/system/cockpit.service',末尾添加内容如下:

[Install]
WantedBy=multi-user.target
举报

相关推荐

0 条评论