Feature #1276
service type pattern match does not include word boundaries
| Status: | Code Insufficient | Start date: | ||
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | service | |||
| Target version: | Telly | |||
| Affected Puppet version: | 0.24.4 | Branch: | ||
| Keywords: | ||||
| Votes: | 1 |
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 over 3 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 over 3 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 over 3 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 over 3 years ago
Testing email notifications to bugs list – please ignore.
Updated by Redmine Admin over 3 years ago
- Status changed from 1 to Needs Decision
Updated by Luke Kanies over 3 years ago
- Status changed from Needs Decision to Accepted
- Affected Puppet version set to 0.24.4
Updated by James Turnbull over 2 years ago
- Assignee deleted (
Puppet Community)
Updated by James Turnbull over 2 years ago
- Assignee set to James Turnbull
- Target version set to 0.25.0
Updated by Luke Kanies over 2 years ago
- Status changed from Accepted to In Topic Branch Pending Review
The patch looks right. Has anyone had a chance to test it?
Updated by James Turnbull over 2 years ago
- Status changed from In Topic Branch Pending Review to Code Insufficient
I have – it doesn’t work and breaks the service tests.
Updated by James Turnbull over 2 years 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 over 2 years ago
- Priority changed from Normal to Low
Updated by James Turnbull about 2 years ago
- Target version changed from 2.6.0 to 2.7.x
Updated by James Turnbull 11 months ago
- Assignee deleted (
James Turnbull)
Updated by Nigel Kersten 10 months ago
- Target version changed from 2.7.x to Telly