puppet agent question

27 views
Skip to first unread message

Brian Lock

unread,
Jan 10, 2015, 12:51:27 PM1/10/15
to puppet...@googlegroups.com
If the puppet agent isn't running on a server and you issue the command  sudo /etc/init.d/puppet stop, and you have also disables execute access on the file /etc/init.d/puppet by chmod -x , why does puppet run from the master at its pre-prescribed time?

Felix Frank

unread,
Jan 11, 2015, 7:08:40 PM1/11/15
to puppet...@googlegroups.com
Well, the init script is not the deciding factor at all. You *could* try
and remove the execute bit from the puppet binary itself but that's
Begging The Question ;-)

jcbollinger

unread,
Jan 12, 2015, 9:40:08 AM1/12/15
to puppet...@googlegroups.com


On Saturday, January 10, 2015 at 11:51:27 AM UTC-6, Brian Lock wrote:
If the puppet agent isn't running on a server and you issue the command  sudo /etc/init.d/puppet stop, and you have also disables execute access on the file /etc/init.d/puppet by chmod -x , why does puppet run from the master at its pre-prescribed time?


Running the agent's service control script with 'stop' as its argument is meaningless if the service is in fact already stopped.  Turning off the execute bit on the service control script might cause the system to error out if when trying to start the agent service via the service control tools, but that's the most you can expect (and even that could depend on the implementation of your service control tools).  In no way does it prevent the agent from being started by other means, whether as a service or not.

If you don't want Puppet ever to run then don't mess around; just uninstall it.

If you want to temporarily prevent the agent from performing catalog runs, then run 'puppet agent --disable'.

If you want to be able to run the agent on demand, but you don't want it to be recognized by your service control tools, then use your service control tools' mechanism for unregistering it.  On RedHat-family systems, for example, you might do 'chkconfig --del puppet'.  Note that this in no way prevents the agent from running as a service; it just prevents your service control tools from being used to start it.

If you want the agent to be installed normally, but for the agent service not to be automatically started by the system, then once again, turn to your service control tools.  On RedHat-family systems, for example, you might do 'chkconfig --level 12345 puppet off'.  Similar to the previous case, this in no way prevents the agent from running as a service; it just prevents your service control tools from starting it automatically.

In any case, you cannot have the Puppet agent available to run on demand without the possibility that it will be started as a service.  In your particular case, however, I suspect you are barking up the wrong tree.  If the agent is running on the system on a regular schedule, but the agent daemon as not running (whether or not started via the system's service control tools), then something else is running it.  It is relatively common for the agent to be run from a general-purpose scheduler (i.e. cron), so I'd look into that possibility.


John

Reply all
Reply to author
Forward
0 new messages