fix stopsignal for go program.
This commit is contained in:
parent
6ee8bb86fe
commit
b7950b3650
@ -1,5 +1,6 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
pidfile=/var/run/supervisord.pid
|
||||
logfile=/dev/null
|
||||
logfile_maxbytes=0
|
||||
@ -44,6 +45,8 @@ redirect_stderr=true
|
||||
[program:neko]
|
||||
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s"
|
||||
command=/usr/bin/neko serve --static "/var/www"
|
||||
stopsignal=INT
|
||||
stopwaitsecs=5
|
||||
autorestart=true
|
||||
priority=800
|
||||
user=%(ENV_USER)s
|
||||
|
@ -67,6 +67,7 @@ For n.eko room management software, visit https://github.com/m1k1o/neko-rooms.
|
||||
- Full-screen support for iOS devices.
|
||||
- Added `chrome-sandbox` to fix weird bug when chromium didn't start.
|
||||
- Fixed keyboard mapping on macOS, when CMD could not be used for copy & paste.
|
||||
- Fixed stop signal sent by supervisor to gracefully shut down neko server.
|
||||
|
||||
### Misc
|
||||
- Custom docker workflow.
|
||||
|
@ -174,11 +174,11 @@ func (neko *Neko) ServeCommand(cmd *cobra.Command, args []string) {
|
||||
neko.Start()
|
||||
neko.logger.Info().Msg("neko ready")
|
||||
|
||||
quit := make(chan os.Signal)
|
||||
quit := make(chan os.Signal, 1)
|
||||
signal.Notify(quit, os.Interrupt)
|
||||
sig := <-quit
|
||||
|
||||
neko.logger.Warn().Msgf("received %s, attempting graceful shutdown: \n", sig)
|
||||
neko.logger.Warn().Msgf("received %s, attempting graceful shutdown", sig)
|
||||
neko.Shutdown()
|
||||
neko.logger.Info().Msg("shutdown complete")
|
||||
}
|
||||
|
Reference in New Issue
Block a user