service httpd does not support chkconfig

一 问题描述

执行systemctl enable httpd的时候报错:

[root@Centos7-Mode-V7 apache]# systemctl enable httpd
httpd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig httpd on
service httpd does not support chkconfig

二 解决办法

修改/etc/rc.d/init.d/httpd,在#!/bin/sh后添加:

# chkconfig: 2345 85 15

shell脚本方式:

#在第二行添加# chkconfig: 2345 85 15即可:

sed -i '2i # chkconfig: 2345 85 15' /etc/rc.d/init.d/httpd

猜你喜欢

转载自blog.csdn.net/yabignshi/article/details/111830478
今日推荐