如何禁止Puppet agent daemon在服务器启动时自动运行?
Solutions for Your Puppet Agent Issues
Got it, let's break down how to fix both of your Puppet agent problems step by step:
1. Stop Puppet Agent from Automatically Running and Killing Apache
First, a quick correction: the command to check your current runinterval is actually puppet agent --configprint runinterval (you don’t need to append 1800 unless you’re actively setting the interval). Here’s what you can do to resolve this:
- Temporarily pause automatic runs: If you need an immediate fix to stop the agent from interfering with Apache, run
puppet agent --disable. This will prevent the agent from executing automatically until you re-enable it withpuppet agent --enable. - Adjust the runinterval permanently: Edit your Puppet agent configuration file (usually
/etc/puppetlabs/puppet/puppet.conffor Puppet Enterprise, or/etc/puppet/puppet.conffor open-source Puppet). In the[agent]section, update therunintervalvalue to a longer interval (e.g.,runinterval = 3600for 1 hour) and save the file. Restart the Puppet service to apply the change. - Fix the root cause of Apache being stopped: The agent is likely executing a manifest that explicitly stops Apache. Run
puppet agent --testmanually to view detailed execution logs—this will show you exactly which resource is triggering the stop. You can then modify your Puppet manifest to remove or adjust that problematic configuration.
2. Prevent Puppet Agent from Starting on Server Reboot
The steps here depend on your server’s init system:
For systemd-based systems (CentOS 7+, Ubuntu 16.04+, etc.)
- Stop the running service first:
systemctl stop puppet - Disable auto-start on boot:
systemctl disable puppet - If you want to ensure the service can’t be started accidentally, mask it:
systemctl mask puppet(usesystemctl unmask puppetto reverse this later)
For SysVinit-based systems (CentOS 6, older Ubuntu versions, etc.)
- Stop the service:
service puppet stop - Disable auto-start:
chkconfig puppet off
内容的提问来源于stack exchange,提问作者Sarath S
相关产品推荐
相关产品推荐

