{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/2741","repository_url":"https://api.github.com/repos/systemd/systemd","labels_url":"https://api.github.com/repos/systemd/systemd/issues/2741/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/2741/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/2741/events","html_url":"https://github.com/systemd/systemd/issues/2741","id":136389818,"number":2741,"title":"Access mounted (ip netns ...) network namespaces.","user":{"login":"dopykuh","id":6775896,"avatar_url":"https://avatars.githubusercontent.com/u/6775896?v=3","gravatar_id":"","url":"https://api.github.com/users/dopykuh","html_url":"https://github.com/dopykuh","followers_url":"https://api.github.com/users/dopykuh/followers","following_url":"https://api.github.com/users/dopykuh/following{/other_user}","gists_url":"https://api.github.com/users/dopykuh/gists{/gist_id}","starred_url":"https://api.github.com/users/dopykuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dopykuh/subscriptions","organizations_url":"https://api.github.com/users/dopykuh/orgs","repos_url":"https://api.github.com/users/dopykuh/repos","events_url":"https://api.github.com/users/dopykuh/events{/privacy}","received_events_url":"https://api.github.com/users/dopykuh/received_events","type":"User","site_admin":false},"labels":[{"id":221925707,"url":"https://api.github.com/repos/systemd/systemd/labels/pid1","name":"pid1","color":"c7def8","default":false},{"id":191919608,"url":"https://api.github.com/repos/systemd/systemd/labels/RFE","name":"RFE","color":"009800","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-02-25T13:36:53Z","updated_at":"2017-01-19T10:59:55Z","closed_at":"2016-04-15T19:29:20Z","body":"### Submission type\n\n> Request for enhancement (RFE)\n### systemd version the issue has been seen with\n\n> 229\n### Used distribution\n\n> Ubuntu 16.04 Xenial\n\nIs there any possibilty to join a named network namespace. I'd like to create units with PrivateNetwork=my_custom_namespace. There are some cases where is would be able to join a namespace which is not created or handled by systemd.\n"},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/273745146","html_url":"https://github.com/systemd/systemd/issues/2741#issuecomment-273745146","issue_url":"https://api.github.com/repos/systemd/systemd/issues/2741","id":273745146,"user":{"login":"ian-kelling","id":54232,"avatar_url":"https://avatars.githubusercontent.com/u/54232?v=3","gravatar_id":"","url":"https://api.github.com/users/ian-kelling","html_url":"https://github.com/ian-kelling","followers_url":"https://api.github.com/users/ian-kelling/followers","following_url":"https://api.github.com/users/ian-kelling/following{/other_user}","gists_url":"https://api.github.com/users/ian-kelling/gists{/gist_id}","starred_url":"https://api.github.com/users/ian-kelling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ian-kelling/subscriptions","organizations_url":"https://api.github.com/users/ian-kelling/orgs","repos_url":"https://api.github.com/users/ian-kelling/repos","events_url":"https://api.github.com/users/ian-kelling/events{/privacy}","received_events_url":"https://api.github.com/users/ian-kelling/received_events","type":"User","site_admin":false},"created_at":"2017-01-19T10:59:55Z","updated_at":"2017-01-19T10:59:55Z","body":"> The problem is not setting up the namespace and its interfaces. They are already up and running. I just need to join the namespace. How do I get a process running as an unprivileged user to join that namespace?\r\n\r\nYou let systemd create the namespace with PrivateNetwork=true, then you setup it's interfaces from within a ExecStart, or more likely an ExecStartPre, and then subsequent calls to Exec... will be in that namespace, and subsequent units join that namespace by using PrivateNetwork=true and JoinsNamespaceOf=. All the subesequent joins can be using unpriviledged users.\r\n\r\nMy script does not make the namespace be named like ip does, because the naming is not necessary, although it could have been done with some more work. For debugging and joining the namespace with a bash shell outside of systemd, I use nsenter -n -m -t $(pgrep PROCESS_IN_NAMESPACE), so using `ip` is not needed. Note: if I knew how to easily ask systemd what pid a unit has, i would do that.\r\n\r\nI added to the documentation of my script to say this same thing."}}
{"actor":{"display_login":"ian-kelling"}}