Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status.pid includes the pid of grep #8720

Closed
holmboe opened this issue Nov 21, 2013 · 8 comments · Fixed by #9025
Closed

status.pid includes the pid of grep #8720

holmboe opened this issue Nov 21, 2013 · 8 comments · Fixed by #9025
Labels
Bug broken, incorrect, or confusing behavior cannot-reproduce cannot be replicated with info/context provided Regression The issue is a bug that breaks functionality known to work in previous releases. severity-low 4th level, cosemtic problems, work around exists

Comments

@holmboe
Copy link
Contributor

holmboe commented Nov 21, 2013

(salt)root@master:~# salt '*' status.pid init
master:
    1
    11756
(salt)root@master:~# ps auxwww | grep init
root         1  0.0  0.3  24424  1296 ?        Ss   Nov13   0:11 /sbin/init
root     11775  0.0  0.2  11688   928 pts/1    S+   20:13   0:00 grep --color=auto init
(salt)root@master:~# salt '*' status.pid init
master:
    1
    11776
(salt)root@master:~# ps auxwww | grep init
root         1  0.0  0.3  24424  1296 ?        Ss   Nov13   0:11 /sbin/init
root     11795  0.0  0.2  11688   928 pts/1    S+   20:13   0:00 grep --color=auto init
(salt)root@master:~# 

And the versions-report:

(salt)root@master:~# salt --versions-report
           Salt: 0.17.0-4830-g37711d8
         Python: 2.7.3 (default, Apr 20 2012, 22:39:59)
         Jinja2: 2.7.1
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 3.2.2
@holmboe
Copy link
Contributor Author

holmboe commented Nov 21, 2013

The code says that it does a grep -v grep to exclude its own grep, but apparently it fails.

@basepi
Copy link
Contributor

basepi commented Nov 21, 2013

Thanks for the report. We'll get this fixed.

@william20111
Copy link

I cant replicate this in my test environment, it seems to work fine for me.

ps aux | grep init
root         1  0.0  0.1  10540   824 ?        Ss   Nov19   0:03 init [3]  
root      2650  0.0  0.2  60420  1436 ?        Ss   Nov19   0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
root     20971  0.0  0.1   4536   564 pts/0    S+   16:25   0:00 grep init

status pid init output :

saltminion:
1
2650

Version info is slightly different tho..

saltmaster:~ # salt --versions-report
       Salt: 0.17.2
     Python: 2.6.8 (unknown, Jul 16 2013, 14:48:55)
     Jinja2: 2.7.1
   M2Crypto: 0.21.1
 msgpack-python: 0.3.0
  msgpack-pure: Not Installed
   pycrypto: 2.6
     PyYAML: 3.10
      PyZMQ: 13.0.0
        ZMQ: 3.2.4

EDIT

I was running SLES 11 SP3.

@cachedout
Copy link
Contributor

I can't replicate this on 0.17.0 or on HEAD. What OS is this?

@holmboe
Copy link
Contributor Author

holmboe commented Nov 29, 2013

This is running in a Virtualbox Vagrant.

(salt)root@master:~# salt '*' status.pid init
master:
    1
    3575
(salt)root@master:~# salt --versions-report
           Salt: 0.17.0-5117-gd64d037
         Python: 2.7.3 (default, Apr 20 2012, 22:39:59)
         Jinja2: 2.7.1
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 3.2.2
(salt)root@master:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.3 LTS
Release:        12.04
Codename:       precise
(salt)root@master:~# uname -a
Linux master 3.2.0-52-generic #78-Ubuntu SMP Fri Jul 26 16:21:44 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

@holmboe
Copy link
Contributor Author

holmboe commented Nov 29, 2013

Another run:

(salt)root@master:~# ps auxwww | grep init
root         1  0.6  0.4  24320  1860 ?        Ss   23:22   0:02 /sbin/init
root      3607  0.0  0.2  11688   928 pts/3    R+   23:29   0:00 grep --color=auto init
(salt)root@master:~# salt '*' status.pid init
master:
    1
    3608

@terminalmage
Copy link
Contributor

Actually, it's not the pid of the grep, it's the pid of the actual salt CLI command. This is only replicable when the master is executing something on the minion itself, because if you're looking for "init", on the master only you're also going to see something like /usr/bin/python /usr/bin/salt master status.pid init in the ps output, which is what causes that pid to show up in the results. This is an easy fix, and I'll have a pull request for this shortly.

@terminalmage
Copy link
Contributor

@holmboe fix is in #9025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior cannot-reproduce cannot be replicated with info/context provided Regression The issue is a bug that breaks functionality known to work in previous releases. severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants