{"action":"created","issue":{"url":"https://api.github.com/repos/opencontainers/runc/issues/1358","repository_url":"https://api.github.com/repos/opencontainers/runc","labels_url":"https://api.github.com/repos/opencontainers/runc/issues/1358/labels{/name}","comments_url":"https://api.github.com/repos/opencontainers/runc/issues/1358/comments","events_url":"https://api.github.com/repos/opencontainers/runc/issues/1358/events","html_url":"https://github.com/opencontainers/runc/pull/1358","id":212196137,"number":1358,"title":"run: implement --delete-if-stopped","user":{"login":"giuseppe","id":67430,"avatar_url":"https://avatars3.githubusercontent.com/u/67430?v=3","gravatar_id":"","url":"https://api.github.com/users/giuseppe","html_url":"https://github.com/giuseppe","followers_url":"https://api.github.com/users/giuseppe/followers","following_url":"https://api.github.com/users/giuseppe/following{/other_user}","gists_url":"https://api.github.com/users/giuseppe/gists{/gist_id}","starred_url":"https://api.github.com/users/giuseppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuseppe/subscriptions","organizations_url":"https://api.github.com/users/giuseppe/orgs","repos_url":"https://api.github.com/users/giuseppe/repos","events_url":"https://api.github.com/users/giuseppe/events{/privacy}","received_events_url":"https://api.github.com/users/giuseppe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-06T17:38:43Z","updated_at":"2017-03-06T21:11:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opencontainers/runc/pulls/1358","html_url":"https://github.com/opencontainers/runc/pull/1358","diff_url":"https://github.com/opencontainers/runc/pull/1358.diff","patch_url":"https://github.com/opencontainers/runc/pull/1358.patch"},"body":"\"run -d container\" and \"run container\" behave in different ways in\r\nwhat they leave after the container exits, \"run container\" cleans up\r\nthe root directory while \"run -d\" requires an additional delete.\r\n\r\nI'd like to have the possibility to run a container without caring if\r\nthere is already an existing one (stopped) with the same id.\r\n\r\nIn addition, the new option will simplify systemd services using runC\r\nas it can be possible to have only one directive:\r\n\r\nExecStart=/usr/local/sbin/runc run --delete-if-stopped -d --pid-file /run/minecraft.pid minecraft-build-container\r\n\r\ninstead of requiring an additional ExecStopPost directive.\r\n\r\nSigned-off-by: Giuseppe Scrivano <gscrivan@redhat.com>"},"comment":{"url":"https://api.github.com/repos/opencontainers/runc/issues/comments/284533606","html_url":"https://github.com/opencontainers/runc/pull/1358#issuecomment-284533606","issue_url":"https://api.github.com/repos/opencontainers/runc/issues/1358","id":284533606,"user":{"login":"giuseppe","id":67430,"avatar_url":"https://avatars3.githubusercontent.com/u/67430?v=3","gravatar_id":"","url":"https://api.github.com/users/giuseppe","html_url":"https://github.com/giuseppe","followers_url":"https://api.github.com/users/giuseppe/followers","following_url":"https://api.github.com/users/giuseppe/following{/other_user}","gists_url":"https://api.github.com/users/giuseppe/gists{/gist_id}","starred_url":"https://api.github.com/users/giuseppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuseppe/subscriptions","organizations_url":"https://api.github.com/users/giuseppe/orgs","repos_url":"https://api.github.com/users/giuseppe/repos","events_url":"https://api.github.com/users/giuseppe/events{/privacy}","received_events_url":"https://api.github.com/users/giuseppe/received_events","type":"User","site_admin":false},"created_at":"2017-03-06T21:11:16Z","updated_at":"2017-03-06T21:11:16Z","body":"Got it.  I added the systemd example more of a side effect, while what I am really trying to accomplish is the possibility to run a runc container and not worry if runc didn't properly clean up the previous run.  In few cases I've observed that the `/run/runc/$ID` wasn't properly deleted and the service couldn't not restart.  Having an option like the proposed one will solve similar issues as runc will try to cleanup what was left on startup.  The alternative would be an `ExecStartPre=/bin/runc delete $NAME` so that the service won't get stuck if `/run/runc/$ID` is still present."}}
{"actor":{"display_login":"giuseppe"}}