mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-16 00:59:58 +00:00
put hupper config in config file
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
@@ -18,18 +18,28 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&path, "path", "/Database/branch/master/watch/com.docker.driver.amd64-linux.node/etc.node/docker.node/daemon.json.node/tree.live", "path of the file to watch")
|
||||
flag.StringVar(&huppidfile, "huppidfile", "/run/docker.pid", "pidfile for process to signal")
|
||||
flag.StringVar(&pidfile, "pidfile", "/run/hupper.pid", "my pidfile")
|
||||
flag.StringVar(&path, "path", "", "path of the file to watch")
|
||||
flag.StringVar(&huppidfile, "huppidfile", "", "pidfile for process to signal")
|
||||
flag.StringVar(&pidfile, "pidfile", "", "my pidfile")
|
||||
}
|
||||
|
||||
func main() {
|
||||
log.SetFlags(0)
|
||||
flag.Parse()
|
||||
|
||||
pid := os.Getpid()
|
||||
pidbytes := []byte(strconv.Itoa(pid))
|
||||
_ = ioutil.WriteFile(pidfile, pidbytes, 0644)
|
||||
if path == "" {
|
||||
log.Fatal("watch path not set")
|
||||
}
|
||||
|
||||
if huppidfile == "" {
|
||||
log.Fatal("huppidfile not set")
|
||||
}
|
||||
|
||||
if pidfile != "" {
|
||||
pid := os.Getpid()
|
||||
pidbytes := []byte(strconv.Itoa(pid))
|
||||
_ = ioutil.WriteFile(pidfile, pidbytes, 0644)
|
||||
}
|
||||
|
||||
watch, err := os.Open(path)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user