Feature #1276
service type pattern match does not include word boundaries
| Status: | Code Insufficient | Start: | ||
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assigned to: | % Done: | 0% |
||
| Category: | service | |||
| Target version: | Statler | |||
| Affected version: | 0.24.4 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
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.
History
Updated by Paul Lathrop about 2 years ago
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
Updated by martin krafft about 2 years ago
- 6 set to Needs design decision
Seems like \bcron\b does not match /usr/bin/cron, which is a ruby bug, I’d say. This thus needs more work/thought/love/attention.
Updated by martin krafft about 2 years ago
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?
To be honest, I’d love to, but I don’t know any ruby to the point where I can even understand the existing tests. I would love to provide one, but I don’t have the time needed to get myself acquainted with ruby right now. Sorry.
Updated by Redmine Admin about 2 years ago
Testing email notifications to bugs list – please ignore.
Updated by Redmine Admin about 2 years ago
- Status changed from 1 to Needs design decision
Updated by Luke Kanies almost 2 years ago
- Status changed from Needs design decision to Accepted
- Affected version set to 0.24.4
Updated by James Turnbull about 1 year ago
- Assigned to deleted (
Puppet Community)
Updated by James Turnbull about 1 year ago
- Assigned to set to James Turnbull
- Target version set to 0.25.0
Updated by Luke Kanies about 1 year ago
- Status changed from Accepted to Ready for Testing
The patch looks right. Has anyone had a chance to test it?
Updated by James Turnbull about 1 year ago
- Status changed from Ready for Testing to Code Insufficient
I have – it doesn’t work and breaks the service tests.
Updated by James Turnbull about 1 year ago
- Target version changed from 0.25.0 to 2.6.0
Bumping this since I can’t get it to work.
Updated by Luke Kanies 11 months ago
- Priority changed from Normal to Low
Updated by James Turnbull 6 months ago
- Target version changed from 2.6.0 to Statler