Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-24 Thread Gabriel Nagy (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Nagy commented on  PUP-10658  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
 Hi Tim Meusel, I investigated this issue a bit more and I was in favor of it initially. However, I think it's a bit of a grey area. The code involving getpid is quite primitive, and the fix is not as simple as enclosing the service name between ^ and $. Since we're parsing the output of ps -ef, processes can show up in a variety of ways. Here are some EL 6 examples: Service: abrtd ps output: root 6509 1 0 09:35 ? 00:00:00 /usr/sbin/abrtd Service: syslog ps output: root 1671 1 0 09:35 ? 00:00:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5 Service: rpcbind ps output: rpc 1723 1 0 09:35 ? 00:00:00 rpcbind I think messing with the check by trying to more closely match the process name could open up a whole can of worms (some processes have arguments, others run under an absolute path). I agree that the current behavior is a bit counterintuitive, but it does work the way it's documented: 

As a last resort, Puppet will attempt to search the process table by calling whatever command is listed in the `ps` fact. The default search pattern is the name of the service, but you can specify it with the `pattern` attribute.
 https://puppet.com/docs/puppet/6.18/types/service.html#service-description  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To 

Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-16 Thread Tim Meusel (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Tim Meusel commented on  PUP-10658  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
 I agree that this might break existing setups that worked by accident. I was hoping this will be fixed for Puppet 7.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.37092.1600257420024%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-16 Thread Dorin Pleava (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dorin Pleava commented on  PUP-10658  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
 Hi Tim Meusel, Indeed the regex seems a bit loose, but changing the ensure regex to have an exact match may have breaking changes. I recommend using the pattern attribute, where you can place an exact regex to match the 'ps -ef' result, like: service  { 'bird':   ensure => 'running',   enable => true,   hasstatus => false,   pattern => '*bird/s*' }  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.37089.1600256700053%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-16 Thread Mihai Buzgau (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mihai Buzgau updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10658  
 
 
  Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
Change By: 
 Mihai Buzgau  
 
 
Sprint: 
 NW - 2020-09-16 , NW - 2020-09-30  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.37028.1600250220267%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-15 Thread Dorin Pleava (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dorin Pleava assigned an issue to Dorin Pleava  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10658  
 
 
  Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
Change By: 
 Dorin Pleava  
 
 
Assignee: 
 Dorin Pleava  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.36086.1600160340032%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-09 Thread Mihai Buzgau (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mihai Buzgau updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10658  
 
 
  Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
Change By: 
 Mihai Buzgau  
 
 
Sprint: 
 PR NW  -  Triage  2020-09-16  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.32309.1599640800035%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-09 Thread Mihai Buzgau (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mihai Buzgau updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10658  
 
 
  Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
Change By: 
 Mihai Buzgau  
 
 
Story Points: 
 3  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.32308.1599640740035%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-08 Thread Mihai Buzgau (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mihai Buzgau updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10658  
 
 
  Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
Change By: 
 Mihai Buzgau  
 
 
Sprint: 
 PR - Triage  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.31593.1599576840027%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-04 Thread Josh Cooper (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Josh Cooper updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10658  
 
 
  Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
Change By: 
 Josh Cooper  
 
 
Team: 
 Night's Watch  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371182.1599213891000.30765.1599234420032%40Atlassian.JIRA.


Jira (PUP-10658) Puppet service ps parsing using too loose regex

2020-09-04 Thread Tim Meusel (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Tim Meusel created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-10658  
 
 
  Puppet service ps parsing using too loose regex   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Unassigned  
 
 
Created: 
 2020/09/04 3:04 AM  
 
 
Priority: 
  Normal  
 
 
Reporter: 
 Tim Meusel  
 

  
 
 
 
 

 
 Puppet Version: 6.18.0 Puppet Server Version: 6.12.0 OS Name/Version: CentOS 6 Hello, I've got two services running, bird and bird6. their processes are also named bird and bird6. If I manage the service via puppet and set hasstatus to false, puppet will parse ps -ef: https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/service/base.rb#L37 If I want to manage the bird service and it's currently not running, but bird6 is running, but will assume that the bird6 process relates to the bird service: from the debug output:  
 
 
 
 
 Debug: Service[bird](provider=redhat): Executing 'ps -ef'  
 
 
 Debug: Executing: 'ps -ef'  
 
 
 Debug: Service[bird](provider=redhat): Process matched: bird6  10046   1  0 Aug28 ?00:16:23 /usr/sbin/bird6 -u bird6 -g bird6
  
 
 
 
  Desired Behavior: I would like to see that the regex won't match, puppet detects the service as off and starts it Actual Behavior: puppet assumes that the bird service is running and won't start it testcode