centos设置服务开机启动失败问题

Posted jinyuanliu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos设置服务开机启动失败问题相关的知识,希望对你有一定的参考价值。

1、安装某服务设置开机启动的时候报错

[[email protected] ~]# systemctl enable lvm2-lvmetad.service
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit‘s
.wants/ or .requires/ directory.
2) A unit‘s purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).

2、添加配置

vim /usr/lib/systemd/system/lvm2-lvmetad.service 

在最后添加如下内容:

[Install]
WantedBy=multi-user.target
重新设置开机启动









以上是关于centos设置服务开机启动失败问题的主要内容,如果未能解决你的问题,请参考以下文章

centos7中设置服务开机自启的两种方法

centos怎样将服务加入开机自动启动

centos设置服务开机启动

CentOS设置程序开机启动程序/服务的方法(转)

CentOS设置服务开机启动的方法

centos7 安装ntp服务并启动,设置开机重启