serve http, webdav, restic: ensure rclone exits if the port is in use
This commit is contained in:
parent
1f05d5bf4a
commit
bb5637d46a
7 changed files with 65 additions and 40 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
|
||||
auth "github.com/abbot/go-http-auth"
|
||||
"github.com/ncw/rclone/fs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Globals
|
||||
|
@ -188,7 +189,7 @@ func NewServer(handler http.Handler, opt *Options) *Server {
|
|||
func (s *Server) Serve() error {
|
||||
ln, err := net.Listen("tcp", s.httpServer.Addr)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrapf(err, "start server failed")
|
||||
}
|
||||
s.listener = ln
|
||||
s.waitChan = make(chan struct{})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue