diff --git a/base/gdb/signal.go b/base/gdb/signal.go index 605268f7..e15d8ab2 100644 --- a/base/gdb/signal.go +++ b/base/gdb/signal.go @@ -50,6 +50,7 @@ func init() { _signal_listen(m, 1, mdb.NAME, START, ice.CMD, "runtime") _signal_listen(m, 2, mdb.NAME, RESTART, ice.CMD, "exit 1") _signal_listen(m, 3, mdb.NAME, STOP, ice.CMD, "exit 0") + _signal_listen(m, int(syscall.SIGUSR1), mdb.NAME, "info", ice.CMD, "runtime") }}, LISTEN: {Name: "listen signal name cmd", Help: "监听", Hand: func(m *ice.Message, arg ...string) { _signal_listen(m, kit.Int(m.Option(SIGNAL)), arg...) diff --git a/base/web/dream.go b/base/web/dream.go index 9d6f221c..2ffde41c 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -7,6 +7,7 @@ import ( "regexp" "runtime" "strings" + "syscall" "time" ice "shylinux.com/x/icebergs" @@ -171,14 +172,16 @@ func _dream_check(m *ice.Message, name string) string { if pid := m.Cmdx(nfs.CAT, p, kit.Dict(ice.MSG_USERROLE, aaa.TECH)); pid != "" && nfs.Exists(m, "/proc/"+pid) { m.Info("already exists %v", pid) return "" - } else { - for i := 0; i < 3; i++ { - if m.Cmd(SPACE, name).Length() > 0 { - m.Info("already exists %v", name) - return "" - } - m.Sleep300ms() + } else if proc, err := os.FindProcess(kit.Int(pid)); err == nil && proc.Signal(syscall.SIGUSR1) == nil { + m.Info("already exists %v", pid) + return "" + } + for i := 0; i < 5; i++ { + if m.Cmd(SPACE, name).Length() > 0 { + m.Info("already exists %v", name) + return "" } + m.Sleep300ms() } } return p