mq-container
mq-container copied to clipboard
runmqserver: fix/improve verifySingleProcess
A couple of patches to improve the runmqserver
check for being the only process.
1. cmd/runmqserver.verifySingleProcess: optimize
Instead of using ps
, which reads three /proc
files per each process
(stat
, status
, and cmdline
), use pgrep
which only reads cmdline.
Also, pgrep
output is simpler -- it only lists PIDs, one per line,
so to find out the number of processes we just need to count newlines.
2. cmd/runmqserver.verifySingleProcess: improve
-
Check
command.Run
error, print it out (as debug only). -
Simplify
verifyOnlyOne()
return values (bool
is enough). -
Add more logging.
@sdmarshall79 @parrobe @LPowlett PTAL
CI failure is unrelated:
Step 3/103 : FROM registry.redhat.io/ubi8/go-toolset:1.13.4-22 as builder Get https://registry.redhat.io/v2/ubi8/go-toolset/manifests/1.13.4-22: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication Makefile:267: recipe for target 'build-devserver' failed make: *** [build-devserver] Error 1 The command "bash -e travis-build-scripts/run.sh" exited with 2.
CI failure is unrelated:
Apparently $(REGISTRY_USER)
and $(REGISTRY_PASS)
are not set in Travis?