Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Automatically symlink /var/run/*.sock sockets to /var/run/weave/*.sock #1696

Merged
merged 3 commits into from
Nov 20, 2015

Conversation

paulbellamy
Copy link
Contributor

Uses approach 1 to fix #1694

Comments on approach vs 2, would be great.

@paulbellamy paulbellamy force-pushed the 1694-symlink-into-var-run branch 2 times, most recently from f199dbe to af7e500 Compare November 18, 2015 14:49
@awh awh self-assigned this Nov 19, 2015
@awh awh added this to the 1.4.0 milestone Nov 19, 2015
weave_on $HOST1 stop
weave_on $HOST1 launch-proxy -H unix:///var/run/weave/weave.sock
assert_raises 'run_on '$HOST1' "eval $(weave env) ; docker '$CMD'"'
assert_raises 'run_on '$HOST1' "docker $(weave config) '$CMD'"'

This comment was marked as abuse.

This comment was marked as abuse.

@paulbellamy paulbellamy force-pushed the 1694-symlink-into-var-run branch from af7e500 to 77bc22b Compare November 19, 2015 11:36
@@ -1552,6 +1571,9 @@ launch_proxy() {
--entrypoint=/home/weave/weaveproxy \
$WEAVEPROXY_DOCKER_ARGS $EXEC_IMAGE $COVERAGE_ARGS $PROXY_ARGS)
wait_for_status $PROXY_CONTAINER_NAME http_call_unix $PROXY_CONTAINER_NAME status.sock
for sock in $PROXY_VAR_RUN_SYMLINKS; do
ln -sf -T "/var/run/weave/$sock" "/host/var/run/$sock"

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@awh
Copy link
Contributor

awh commented Nov 19, 2015

Can you think of any compelling reasons why we would choose option 2? I think I prefer option 1.

@awh awh assigned paulbellamy and unassigned awh Nov 19, 2015
@paulbellamy
Copy link
Contributor Author

Option 2 makes for more consistent handling of unix sockets. It means we're not special-casing sockets in /var/run, they're handled the same as anywhere else. But it is ~30-70 more lines of code (because running docker containers from go is more work than from cli)

@paulbellamy
Copy link
Contributor Author

Ok, test is failing because docker unix socket is only accessible to root:docker on gce.

@paulbellamy paulbellamy force-pushed the 1694-symlink-into-var-run branch from 5c75f2c to 33648b0 Compare November 19, 2015 14:10
@paulbellamy paulbellamy assigned awh and unassigned paulbellamy Nov 19, 2015
@awh
Copy link
Contributor

awh commented Nov 20, 2015

Option 2 makes for more consistent handling of unix sockets. It means we're not special-casing sockets in /var/run, they're handled the same as anywhere else. But it is ~30-70 more lines of code (because running docker containers from go is more work than from cli)

Another idea - how about having the weave script symlink all unix:/// args (anywhere in the filesystem - no special casing) to /var/run/weave/weave.sock and then have the proxy listen to that single socket?

@awh awh assigned paulbellamy and awh and unassigned awh and paulbellamy Nov 20, 2015
@awh
Copy link
Contributor

awh commented Nov 20, 2015

If someone does

$ weave launch-proxy -H unix:///var/run/test.sock

would they find the path returned by this

$ weave env
export DOCKER_HOST=unix:///var/run/weave/test.sock ORIG_DOCKER_HOST=

surprising?

@paulbellamy
Copy link
Contributor Author

Their level of surprise probably depends on what they expected it to return.

Edit: Just actually read the result, yeah that's probably not right.

@awh awh changed the title Automatically symlink /var/run/*.sock sockets from /var/run/weave.sock Automatically symlink /var/run/*.sock sockets to /var/run/weave/*.sock Nov 20, 2015
awh added a commit that referenced this pull request Nov 20, 2015
Automatically symlink /var/run/*.sock sockets to /var/run/weave/*.sock
@awh awh merged commit 1432bd7 into master Nov 20, 2015
@paulbellamy paulbellamy deleted the 1694-symlink-into-var-run branch November 30, 2015 10:57
@bboreham bboreham modified the milestones: n/a, 1.4.0 Dec 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically symlink when proxying unix domain sockets under /var/run
3 participants