mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
These changes allow you to force the re-creation of existing Unix domain sockets and set the permissions of sockets after they have been created. The flag or variable value for this must be formatted as follows: --http-host="unix:/var/run/photoprism.sock?force=true&mode=660" Signed-off-by: Michael Mayer <michael@photoprism.app>
24 lines
377 B
Go
24 lines
377 B
Go
package server
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
// Signal channel for initiating the shutdown.
|
|
var Signal = make(chan os.Signal)
|
|
|
|
// Fail reports an error and shuts down the server.
|
|
func Fail(err string, params ...interface{}) {
|
|
if err != "" {
|
|
log.Errorf(err, params...)
|
|
}
|
|
|
|
Shutdown()
|
|
}
|
|
|
|
// Shutdown gracefully stops the server.
|
|
func Shutdown() {
|
|
Signal <- syscall.SIGINT
|
|
}
|