Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reloading config & mirrorz-d files #10

Open
taoky opened this issue Feb 27, 2024 · 2 comments
Open

Support reloading config & mirrorz-d files #10

taoky opened this issue Feb 27, 2024 · 2 comments

Comments

@taoky
Copy link
Member

taoky commented Feb 27, 2024

No description provided.

@iBug
Copy link
Collaborator

iBug commented Feb 27, 2024

Already exists:

mirrorz-302/302.go

Lines 80 to 96 in 88356e1

switch sig {
case syscall.SIGHUP:
logger.Infof("Got A HUP Signal! Now Reloading mirrorz.d.json....\n")
s.LoadMirrorZD()
case syscall.SIGUSR1:
logger.Infof("Got A USR1 Signal! Now Reloading config.json....\n")
LoadConfig(*configPtr)
case syscall.SIGUSR2:
logger.Infof("Got A USR2 Signal! Now Reopen log file....\n")
err := s.InitLoggers()
if err != nil {
logger.Errorf("Error reopening log file: %v\n", err)
}
case syscall.SIGWINCH:
logger.Infof("Got A WINCH Signal! Now Flush Resolved....\n")
s.CachePurge()
}

@iBug iBug closed this as completed Feb 27, 2024
@taoky
Copy link
Member Author

taoky commented Feb 27, 2024

  • Use SIGHUP for reloading everything
  • Add support in systemd service file

@taoky taoky reopened this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants