mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
add some
This commit is contained in:
parent
66a529cec0
commit
8d3cc5239e
@ -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...)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user