Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

UNIX sockets not cleaned up on exit #419

@Daniel15

Description

@Daniel15

I'm using Supervisord to run Kestrel for my site. This is my Supervisor config:

[program:dan]
command=/var/www/.dnx/runtimes/dnx-mono.1.0.0-rc1-final/bin/dnx --appbase /var/www/dan.cx/live/site/approot/packages/Daniel15.Web/1.0.0/root Microsoft.Dnx.ApplicationHost --configuration Release web-live
environment=ASPNET_ENV=Production
user=www-data
directory=/var/www/dan.cx/live/site/

Command in project.json:

"web-live": "Microsoft.AspNet.Server.Kestrel --server.urls http://unix:/run/dan-live.sock",

This is working fine, but when I stop Kestrel (supervisorctl stop dan, "dan" being the name of the site in the Supervisor config), it does not clean up the UNIX socket (/run/dan-live.sock). The next time I try to start it, I get an "address already in use" error:

Microsoft.AspNet.Server.Kestrel.Networking.UvException: Error -98 EADDRINUSE address already in use
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Check (Int32 statusCode) <0x41d3a2a0 + 0x00063> in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.pipe_bind (Microsoft.AspNet.Server.Kestrel.Networking.UvPipeHandle handle, System.String name) <0x41d3e0e0 + 0x00053> in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Networking.UvPipeHandle.Bind (System.String name) <0x41d3e0a0 + 0x00027> in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Http.PipeListener.CreateListenSocket () <0x41d3d9c0 + 0x00087> in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Http.Listener+<>c__DisplayClass5_0.<StartAsync>b__0 (System.Object _) <0x41d3d8c0 + 0x00030> in <filename unknown>:0

I need to manually rm /run/dan-live.sock before I can start Kestrel again. I think Kestrel simply needs to delete the socket on exit.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions