Puppet: System Administration Automated

Support

Ticket #1276 (new enhancement)

Opened 7 months ago

Last modified 7 months ago

service type pattern match does not include word boundaries

Reported by: madduck Assigned to: community
Priority: normal Milestone:
Component: service Version: 0.24.4
Severity: normal Keywords: service name regexp word bounardies
Cc: Triage Stage: Needs more info
Attached Patches: Code Complexity: Trivial

Description

Previously, unless a pattern was defined for a service type, puppet would check the process table for the service name instead. It would use plain string matching. In the case of "cron", an existing process "cronolog" would cause puppet to assume that "cron" was already running.

This patch makes the default pattern be a regular expression, matching on the service name enclosed by word boundaries:

/\b${name}d?\b/

Since many daemons end in 'd', a final 'd' is optional.

Thanks to David Schmitt for his help.

Attachments

0001-Default-service-pattern-match-with-word-boundaries.patch (1.4 kB) - added by madduck on 06/02/08 09:55:23.
git patch against master

Change History

06/02/08 09:55:23 changed by madduck

  • attachment 0001-Default-service-pattern-match-with-word-boundaries.patch added.

git patch against master

06/03/08 03:03:18 changed by plathrop

  • complexity changed from Unknown to Trivial.
  • stage changed from Unreviewed to Needs more info.

madduck,

This looks pretty good. Can you also add tests which will fail when run against the existing code, but succeed when running with your patch?

Thanks!

--Paul