```
Process Publisher-6:
Traceback (most recent call last):
File "/usr/lib64/python2.6/multiprocessing/process.py", line 232, in _bootstrap
self.run()
File "/home/thjackso/src/salt-github/salt/master.py", line 403, in run
package = pull_sock.recv()
File "socket.pyx", line 628, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:5616)
File "socket.pyx", line 662, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:5436)
File "socket.pyx", line 139, in zmq.backend.cython.socket._recv_copy (zmq/backend/cython/socket.c:1771)
File "checkrc.pxd", line 11, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/socket.c:5863)
File "/home/thjackso/src/salt-github/salt/utils/process.py", line 242, in kill_children
p_map['Process'].join(0)
File "/usr/lib64/python2.6/multiprocessing/process.py", line 117, in join
assert self._parent_pid == os.getpid(), 'can only join a child process'
AssertionError: can only join a child process
```
In testing, sometimes `net stop` might not stop the service, but
checking the service using `sc query` immediately afterwards reported
the service as stopped (I suspect a process scheduling issue, but have
no real evidence of that).
Changes the logic to check using `sc query` and then sleep only if we're
not stopped (as opposed to sleep, then check using `sc query`).
This results in a few different execution paths:
* `net stop` works, we exit
* `net stop` fails, `sc query` reports the service is stopped, we exit
* `net stop` fails, `sc query` reports the service is NOT stopped, we
sleep then check again
This approach should have us sleeping only if we really need to.
The original check (4e1c367) for sysctl assign failure queries the
format returned by sysctl on stdout. It was added evidently for some
container system called Virtuozzo. A later commit (4e1c367) strengthens
the check into a full regex on sysctl stdout.
Unfortunately, it appears that on a contemporary conventional distro,
CentOS 7, sysctl repeats the config it is given on stdout whether or not
the config requested is valid. Furthermore, an invalid config request
will not cause sysctl to return a nonzero status. It does print an
error on stderr, so I've added an optional additional check of stderr.
Examples:
centos-7 # sysctl net.ipv4.ip_forward=1 ; echo $?
net.ipv4.ip_forward = 1
0
centos-7 # sysctl net.ipv4.ip_forward=backward ; echo $?
sysctl: setting key "net.ipv4.ip_forward": Invalid argument
net.ipv4.ip_forward = backward
0