CentOS/Rocky8中设置cockpit自启动

Posted t_huanghai

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 units
  .wants/ or .requires/ directory.
• A units 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

以上是关于CentOS/Rocky8中设置cockpit自启动的主要内容,如果未能解决你的问题,请参考以下文章

电脑开机软件自动启动怎么弄

centos7安装cockpit图形管理界面

怎么设置禁止电脑开机软件自动启动

Linux 管理工具 Cockpit 安装及使用

Cockpit 服务化管理工具

openwrt不能自启插件原因