mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
auto remove previous leftover socket
This commit is contained in:
parent
633a4aed18
commit
8a1166c021
|
@ -269,10 +269,10 @@ func (fo *FilerOptions) startFiler() {
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
if *fo.localSocket == "" {
|
if *fo.localSocket == "" {
|
||||||
*fo.localSocket = fmt.Sprintf("/tmp/seaweefs-filer-%d.sock", *fo.port)
|
*fo.localSocket = fmt.Sprintf("/tmp/seaweefs-filer-%d.sock", *fo.port)
|
||||||
|
}
|
||||||
if err := os.Remove(*fo.localSocket); err != nil && !os.IsNotExist(err) {
|
if err := os.Remove(*fo.localSocket); err != nil && !os.IsNotExist(err) {
|
||||||
glog.Fatalf("Failed to remove %s, error: %s", *fo.localSocket, err.Error())
|
glog.Fatalf("Failed to remove %s, error: %s", *fo.localSocket, err.Error())
|
||||||
}
|
}
|
||||||
}
|
|
||||||
go func() {
|
go func() {
|
||||||
// start on local unix socket
|
// start on local unix socket
|
||||||
filerSocketListener, err := net.Listen("unix", *fo.localSocket)
|
filerSocketListener, err := net.Listen("unix", *fo.localSocket)
|
||||||
|
|
Loading…
Reference in a new issue