提交 670be3ac authored 作者: blu's avatar blu

evdaemon.service: modify for eth only and others

上级 21931b95
[Unit]
Description=evdaemon manages edge evsuits
# #for wifi only
After=evwifi.service
# #for eth0 only
# After=network-online.target
# Wants=network-online.target
# #for both
# After=network-online.target evwifi.service
# Wants=network-online.target evwifi.service
[Service]
Type=simple
......@@ -8,6 +16,7 @@ Environment="LD_LIBRARY_PATH=/root/work/opencv-pocs/opencv-motion-detect/vendor/
ExecStart=/root/work/opencv-pocs/opencv-motion-detect/evdaemon
WorkingDirectory=/root/work/opencv-pocs/opencv-motion-detect
Restart=always
StartLimitIntervalSec=0
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=evsuits
......
......@@ -62,6 +62,12 @@ private:
for(auto &ipc : ipcs) {
json &modules = ipc["modules"];
string ipcSn = ipc["sn"];
// mgrsn2ipc
if(peerData["mgr2ipc"].count(k) == 0) {
peerData["mgr2ipc"][k] = json();
}
peerData["mgr2ipc"][k][ipcSn] = 1;
for(auto &[mn, ma]: modules.items()) {
for(auto &m:ma) {
string modGid;
......@@ -110,12 +116,6 @@ private:
// mod2ipc
peerData["mod2ipc"][modGid] = ipcSn;
// mgrsn2ipc
if(peerData["mgr2ipc"].count(k) == 0) {
peerData["mgr2ipc"][k] = json();
}
peerData["mgr2ipc"][k][ipcSn] = 1;
if(shad["expected"].count(modGid) != 0) {
//multiple mod with same class
spdlog::error("{} configuration for ipc {} in dev {} having multiple modules {}. ignored that extra module", devSn, ipcSn, k, modGid);
......
......@@ -63,7 +63,7 @@ private:
string daemonId = this->devSn + ":evdaemon:0";
if(peerId == daemonId) {
if(metaValue == EV_MSG_META_VALUE_CMD_STOP || metaValue == EV_MSG_META_VALUE_CMD_RESTART) {
spdlog::info("{} received {} cmd from cluster mgr {}", devSn, metaValue, daemonId);
spdlog::info("{} received {} cmd from cluster daemon {}", devSn, metaValue, daemonId);
bProcessed = true;
exit(0);
}
......
......@@ -970,7 +970,7 @@ public:
exit(1);
}
spdlog::info("evmlmotio {} boot", selfId);
spdlog::info("evmlmotion {} boot", selfId);
SingletonProcess self(selfName, iid);
if(!self()){
spdlog::error("{} already running. ignore this instance", selfId);
......
......@@ -208,7 +208,7 @@ int forkSubsystem(string devSn, string peerId, int drPort, pid_t &pid){
string modName = v[1];
string sn = v[0];
if( (pid = fork()) == -1 ) {
spdlog::error("evdamon {} failed to fork subsytem - evmgr", devSn);
spdlog::error("evdamon {} failed to fork subsytem: {}", devSn, peerId);
return -1;
}else if(pid == 0) {
ret += setenv("PEERID", peerId.c_str(), 1);
......@@ -218,7 +218,7 @@ int forkSubsystem(string devSn, string peerId, int drPort, pid_t &pid){
return -2;
}
execl((string("./") + modName).c_str(), NULL, NULL, NULL);
spdlog::error("evdaemon {} failed to startup evmgr", devSn);
spdlog::error("evdaemon {} failed to startup: {}", devSn, peerId);
}else{
// parent
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论