Skip to content

bitxel/socket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gracefully deploy/restart server

Usage

  1. Go get && import this repo
    go get github.com/bitxel/socket
  1. Update code, change net.Listen to socket.Listen
    l, err := socket.Listen("tcp", ":12345")
  1. Handle singal USR2 && run new binary
    sigch := make(chan os.Signal, 1)
    signal.Notify(sigch, syscall.SIGUSR2)
    <-sigch
    socket.Fork()
  1. Test
    kill -USR2 pid

Demo

Link

About

Golang gracefully deploy/restart server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages