Skip to content

Commit

Permalink
add NETSHAER_SOCKET_NAME to set the interface socket name
Browse files Browse the repository at this point in the history
  • Loading branch information
fenghui committed Aug 9, 2017
1 parent e36c55d commit 499550e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion netshare/netshare.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const (
EnvNfsVers = "NETSHARE_NFS_VERSION"
EnvTCP = "NETSHARE_TCP_ENABLED"
EnvTCPAddr = "NETSHARE_TCP_ADDR"
EnvSocketName = "NETSHARE_SOCKET_NAME"
PluginAlias = "netshare"
NetshareHelp = `
docker-volume-netshare (NFS V3/4, AWS EFS and CIFS Volume Driver Plugin)
Expand Down Expand Up @@ -238,7 +239,11 @@ func start(dt drivers.DriverType, driver volume.Driver) {
}
fmt.Println(h.ServeTCP(dt.String(), addr, nil))
} else {
fmt.Println(h.ServeUnix(dt.String(), syscall.Getgid()))
socketName := os.Getenv(EnvSocketName)
if socketName == "" {
socketName = dt.String()
}
fmt.Println(h.ServeUnix(socketName, syscall.Getgid()))
}
}

Expand Down

0 comments on commit 499550e

Please sign in to comment.