mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-25 03:34:58 +00:00
put hupper config in config file
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
73a0d72378
commit
40814e4779
@ -15,24 +15,26 @@ start()
|
|||||||
|
|
||||||
ebegin "Starting docker config update manager"
|
ebegin "Starting docker config update manager"
|
||||||
|
|
||||||
[ -n "${PIDFILE}" ] || PIDFILE=/run/hupper.pid
|
PIDFILE=/run/hupper.pid
|
||||||
|
DOCKERPIDFILE=/run/docker.pid
|
||||||
|
|
||||||
start-stop-daemon --start --quiet \
|
start-stop-daemon --start --quiet \
|
||||||
--background \
|
--background \
|
||||||
--exec /bin/hupper \
|
--exec /bin/hupper \
|
||||||
--make-pidfile --pidfile ${PIDFILE} \
|
--make-pidfile --pidfile ${PIDFILE} \
|
||||||
--
|
-- -pidfile ${PIDFILE} -huppidfile ${DOCKERPIDFILE} \
|
||||||
|
-path /Database/branch/master/watch/com.docker.driver.amd64-linux.node/etc.node/docker.node/daemon.json.node/tree.live
|
||||||
|
|
||||||
eend $? "Failed to start hupper"
|
eend $? "Failed to start hupper"
|
||||||
}
|
}
|
||||||
|
|
||||||
stop()
|
stop()
|
||||||
{
|
{
|
||||||
[ -d /Databse ] || exit 0
|
[ -d /Database ] || exit 0
|
||||||
|
|
||||||
ebegin "Stopping docker config update manager"
|
ebegin "Stopping docker config update manager"
|
||||||
|
|
||||||
[ -n "${PIDFILE}" ] || PIDFILE=/run/hupper.pid
|
PIDFILE=/run/hupper.pid
|
||||||
|
|
||||||
start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
|
start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
|
||||||
|
|
||||||
|
@ -18,18 +18,28 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
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(&path, "path", "", "path of the file to watch")
|
||||||
flag.StringVar(&huppidfile, "huppidfile", "/run/docker.pid", "pidfile for process to signal")
|
flag.StringVar(&huppidfile, "huppidfile", "", "pidfile for process to signal")
|
||||||
flag.StringVar(&pidfile, "pidfile", "/run/hupper.pid", "my pidfile")
|
flag.StringVar(&pidfile, "pidfile", "", "my pidfile")
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if path == "" {
|
||||||
|
log.Fatal("watch path not set")
|
||||||
|
}
|
||||||
|
|
||||||
|
if huppidfile == "" {
|
||||||
|
log.Fatal("huppidfile not set")
|
||||||
|
}
|
||||||
|
|
||||||
|
if pidfile != "" {
|
||||||
pid := os.Getpid()
|
pid := os.Getpid()
|
||||||
pidbytes := []byte(strconv.Itoa(pid))
|
pidbytes := []byte(strconv.Itoa(pid))
|
||||||
_ = ioutil.WriteFile(pidfile, pidbytes, 0644)
|
_ = ioutil.WriteFile(pidfile, pidbytes, 0644)
|
||||||
|
}
|
||||||
|
|
||||||
watch, err := os.Open(path)
|
watch, err := os.Open(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user