大网数据广告活动
服务器运维问答

puppet no longer able to manage services on ubuntu 18

· 52CE 我爱测

I've tried to set up a new server via our puppet-master. It was supposed to be a quick affair, everything in there has been running pretty reliably, and still is on the older servers. Just that the new server is the first that is…

问题原文

原帖链接 · UncleBob · CC BY-SA 4.0

I've tried to set up a new server via our puppet-master. It was supposed to be a quick affair, everything in there has been running pretty reliably, and still is on the older servers.

Just that the new server is the first that is running Ubuntu 18, and puppet seems unable to start the services. Here's an example of an error I'm getting when trying to ensure a service is running:

Error: /Stage[main]/Influxdb/Service[influxdb]/ensure: change from stopped to running failed: Could not find init script for 'influxdb'

In the debug output I can see the following things:

Executing: '/usr/sbin/service influxdb status'
Service[influxdb](provider=debian): Could not find influxdb in /etc/init.d
Service[influxdb](provider=debian): Could not find influxdb.sh in /etc/init.d

There is in fact no file relating to the service in /etc/init.d, but that was never required before. If I run sudo /usr/sbin/service influxdb status from the console, the command works. So why is the puppet agent unable to manage the service exactly?

Note that I'm not 100% sure that the problem is with ubuntu 18. That's just the only significant thing I can think of that's changed, and apparently there were some changes with systemd in Ubuntu 18, though I'm not quite clear yet on what they are exactly. What I would like is a solution that does not require me to rewrite all my service files, and have a puppet setup that works on the servers still running the old OS as well as servers running the new one. Can anybody help me achieve this?

已采纳解答

原帖链接 · bodgit · CC BY-SA 4.0

So the cause of this is using too old a version of Puppet on too newer an OS. Puppet 4.10.12 (which the OP is using) doesn't know about Ubuntu 18.04 and the fact that it uses systemd as the chosen init system. The heuristics in that version of Puppet basically know that systemd is used on Ubuntu versions from 15.04 to 17.10 inclusive. In Puppet version 5.3.6 which officially adds support for Ubuntu 18.04, that version is added to the list of versions known to use systemd. In later versions of Puppet the logic is flipped to say systemd is used on every version of Ubuntu except versions 10.04 to 14.10 which should make things easier when the next Ubuntu release comes along.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。