[SUSE]安装Service无法enable的问题

[SUSE]安装Service无法enable的问题

Xy718 854 2022-07-06

自官方CentOS8的维护结束,改为CentOS Stream时,我们公司的大部分生产环境都切换为了SUSE Linux Enterprise Server 15 SP3

在制作镜像安装服务时遇到了无法enable服务的问题:

host:~ # systemctl enable metricbeat.service 
Synchronizing state of metricbeat.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable metricbeat
/sbin/insserv: No such file or directory
host:~ # 

是因为SUSE不自带insserv-compat软件包,安装即可:

zypper install -y insserv-compat

image.png

完事~

host:~ # systemctl enable metricbeat.service
Synchronizing state of metricbeat.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable metricbeat
Created symlink /etc/systemd/system/multi-user.target.wants/metricbeat.service → /lib/systemd/system/metricbeat.service.

冶心·练体·得技