question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong "ps" parameter in start/stop scripts when using alpine based docker image

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ZacBlancocommented, Aug 19, 2019

Additionally, with respect to the proposed solution; while pgrep may be available in busybox, I don’t think it as portable as ps.

ps is a command defined in the UNIX specification: http://pubs.opengroup.org/onlinepubs/7990989775/xcuix.html

The 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?

0reactions
madanaditcommented, Aug 21, 2019

I agree that we should change our entrypoint (to use exec) and get rid of the docker bin directory

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found