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

podman run --cidfile: fail if path exists #530

Closed
edsantiago opened this issue Mar 22, 2018 · 4 comments
Closed

podman run --cidfile: fail if path exists #530

edsantiago opened this issue Mar 22, 2018 · 4 comments
Assignees
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

podman happily clobbers an existing cidfile:

# touch /tmp/mycid
# podman run --cidfile /tmp/mycid fedora date
Thu Mar 22 15:05:26 UTC 2018

docker fails with a helpful diagnostic:

/usr/bin/docker-current: Container ID file found, make sure the other container isn't running or delete /tmp/mycid.

This is a judgment call: one can imagine a UNIX old-timer ranting about overprotective tools and let me shoot myself in the foot if I want to and get off my lawn. I lean that way myself at times. Still... the cost of debugging a problem is much higher if the cidfile is silently overwritten. I would recommend following the docker convention. (Bonus: I think the diagnostic would be more readable as 'Will not overwrite existing cidfile "/tmp/mycid"')

@mheon
Copy link
Member

mheon commented Mar 22, 2018

This is probably 3 lines of code, so I vote we fix it.

@baude baude self-assigned this Mar 22, 2018
@baude
Copy link
Member

baude commented Mar 22, 2018

indeed, ill take it

baude added a commit to baude/podman that referenced this issue Mar 22, 2018
Both podman run and create have an option to write the container ID to a file. The option
is called cidfile.  If the cidfile exists, we should not create or run a container but rather
output a sensical error message.

Resolves: containers#530

Signed-off-by: baude <[email protected]>
@baude
Copy link
Member

baude commented Mar 22, 2018

well if this was name that tune, I would lose. it took me six lines (3 lines in two places)

@rhatdan
Copy link
Member

rhatdan commented Mar 23, 2018

Yes lets fix it.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants