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

Container pidfile not being overridden correctly #504

Closed
TeknoVenus opened this issue Sep 24, 2020 · 1 comment · Fixed by #505
Closed

Container pidfile not being overridden correctly #504

TeknoVenus opened this issue Sep 24, 2020 · 1 comment · Fixed by #505

Comments

@TeknoVenus
Copy link
Contributor

When starting a container with the --pid-file argument, if the file already contains data it will only be partially overridden with the containers PID.

This causes an issue if restarting a container and using the same pid file if the new container gets assigned a PID with less digits.

Example:

  • PID file does not exist. Container starts and is assigned the PID 21948. 21948 is written to the pidfile correctly
  • Stop and restart the container using the same pidfile. Container is now assigned the PID 7694. The pid file now contains 76948, which is incorrect. The file should just contain 7694

Obviously we could work around this and ensure the pidfile was deleted every time the container stops, but crun should override the entire file with the new PID instead of just overriding the number of digits it needs to and leaving the rest.

Crun version: 0.14.1

giuseppe added a commit to giuseppe/crun that referenced this issue Sep 24, 2020
@giuseppe
Copy link
Member

opened a PR here: #505

giuseppe added a commit to giuseppe/crun that referenced this issue Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants