Clean up remove caddy refs (#139)
* Changed reference to Caddy over to CoreDNS * Removing references to caddy * Fixed misleading error message to reference coredns * Cleaning up references to caddy * Adding clean and deps targets Muscle memory is resulting in "make clean" commands. * Adding test target to makefile * More "Caddy" cleanup
This commit is contained in:
parent
bba63f7765
commit
e34280e7af
19 changed files with 146 additions and 134 deletions
|
@ -48,28 +48,28 @@ func trapSignalsPosix() {
|
|||
case syscall.SIGUSR1:
|
||||
log.Println("[INFO] SIGUSR1: Reloading")
|
||||
|
||||
var updatedCaddyfile Input
|
||||
var updatedCorefile Input
|
||||
|
||||
caddyfileMu.Lock()
|
||||
if caddyfile == nil {
|
||||
corefileMu.Lock()
|
||||
if corefile == nil {
|
||||
// Hmm, did spawing process forget to close stdin? Anyhow, this is unusual.
|
||||
log.Println("[ERROR] SIGUSR1: no Corefile to reload (was stdin left open?)")
|
||||
caddyfileMu.Unlock()
|
||||
corefileMu.Unlock()
|
||||
continue
|
||||
}
|
||||
if caddyfile.IsFile() {
|
||||
body, err := ioutil.ReadFile(caddyfile.Path())
|
||||
if corefile.IsFile() {
|
||||
body, err := ioutil.ReadFile(corefile.Path())
|
||||
if err == nil {
|
||||
updatedCaddyfile = CaddyfileInput{
|
||||
Filepath: caddyfile.Path(),
|
||||
updatedCorefile = CorefileInput{
|
||||
Filepath: corefile.Path(),
|
||||
Contents: body,
|
||||
RealFile: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
caddyfileMu.Unlock()
|
||||
corefileMu.Unlock()
|
||||
|
||||
err := Restart(updatedCaddyfile)
|
||||
err := Restart(updatedCorefile)
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] SIGUSR1: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue