Wrong "ps" parameter in start/stop scripts when using alpine based docker image
See original GitHub issueIn file $ALLUXIO_HOME/bin/alluxio in line 83 the call ps -Aww fails because busybox doesn’t know the ‘w’ flag. busybox is used when the environment is alpine (docker image!)
I suggest using pgrep instead of parsing the output of ps like this:
replace
for pid in $(ps -Aww -o pid,command | grep -i "[j]ava" | grep ${keyword} | awk '{print $1}'); do
with
for pid in $(pgrep -f "[j]ava.*$keyword"); do
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Docker Compose release notes
Fixed compose#9983; Fixed parsing issue when a container number label is not found. ... Removed error message showing exit code when using --exit-code-from....
Read more >Building, running, and managing containers
Podman manages pods and container images. With Buildah you can build, update, and manage container images. With Skopeo, you copy and inspect images...
Read more >Docker container will automatically stop after "docker run -d"
A docker ps would show the centos container still running. From there, you can attach to it or detach from it (or docker...
Read more >Apache Karaf Container 4.x - Documentation
With this argument, you can define when you want to shutdown the Apache ... we saw the different scripts and commands to start,...
Read more >How to set up Docker on Alpine Linux - Anto Online
You will also see how to: add Portainer to make Container management a breeze and use Docker to start and stop containers. YouTube...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Additionally, with respect to the proposed solution; while
pgrep
may be available in busybox, I don’t think it as portable asps
.ps
is a command defined in the UNIX specification: http://pubs.opengroup.org/onlinepubs/7990989775/xcuix.htmlThe actual command specification can be found here: http://pubs.opengroup.org/onlinepubs/7990989775/xcu/ps.html
I think it would be most portable if we are to only use
ps
and the arguments defined in the page above. What do you think?I agree that we should change our entrypoint (to use exec) and get rid of the docker bin directory