main: remove stale socket, if it exists
This commit is contained in:
parent
dd3b837d8d
commit
a63a408c06
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
|
@ -12,6 +12,11 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
err := os.Remove("/run/weldr/api.socket")
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
listener, err := net.Listen("unix", "/run/weldr/api.socket")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue