Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
670be3ac
提交
670be3ac
authored
2月 18, 2020
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
evdaemon.service: modify for eth only and others
上级
21931b95
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
19 行增加
和
10 行删除
+19
-10
evdaemon.service
opencv-motion-detect/deployment/evdaemon.service
+9
-0
evcloudsvc.cpp
opencv-motion-detect/evcloudsvc.cpp
+6
-6
evmgr.cpp
opencv-motion-detect/evmgr.cpp
+1
-1
evmlmotion.cpp
opencv-motion-detect/evmlmotion.cpp
+1
-1
zmqhelper.cpp
opencv-motion-detect/inc/zmqhelper.cpp
+2
-2
没有找到文件。
opencv-motion-detect/deployment/evdaemon.service
浏览文件 @
670be3ac
[Unit]
[Unit]
Description=evdaemon manages edge evsuits
Description=evdaemon manages edge evsuits
# #for wifi only
After=evwifi.service
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]
[Service]
Type=simple
Type=simple
...
@@ -8,6 +16,7 @@ Environment="LD_LIBRARY_PATH=/root/work/opencv-pocs/opencv-motion-detect/vendor/
...
@@ -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
ExecStart=/root/work/opencv-pocs/opencv-motion-detect/evdaemon
WorkingDirectory=/root/work/opencv-pocs/opencv-motion-detect
WorkingDirectory=/root/work/opencv-pocs/opencv-motion-detect
Restart=always
Restart=always
StartLimitIntervalSec=0
StandardOutput=syslog
StandardOutput=syslog
StandardError=syslog
StandardError=syslog
SyslogIdentifier=evsuits
SyslogIdentifier=evsuits
...
...
opencv-motion-detect/evcloudsvc.cpp
浏览文件 @
670be3ac
...
@@ -62,6 +62,12 @@ private:
...
@@ -62,6 +62,12 @@ private:
for
(
auto
&
ipc
:
ipcs
)
{
for
(
auto
&
ipc
:
ipcs
)
{
json
&
modules
=
ipc
[
"modules"
];
json
&
modules
=
ipc
[
"modules"
];
string
ipcSn
=
ipc
[
"sn"
];
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
&
[
mn
,
ma
]
:
modules
.
items
())
{
for
(
auto
&
m
:
ma
)
{
for
(
auto
&
m
:
ma
)
{
string
modGid
;
string
modGid
;
...
@@ -110,12 +116,6 @@ private:
...
@@ -110,12 +116,6 @@ private:
// mod2ipc
// mod2ipc
peerData
[
"mod2ipc"
][
modGid
]
=
ipcSn
;
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
)
{
if
(
shad
[
"expected"
].
count
(
modGid
)
!=
0
)
{
//multiple mod with same class
//multiple mod with same class
spdlog
::
error
(
"{} configuration for ipc {} in dev {} having multiple modules {}. ignored that extra module"
,
devSn
,
ipcSn
,
k
,
modGid
);
spdlog
::
error
(
"{} configuration for ipc {} in dev {} having multiple modules {}. ignored that extra module"
,
devSn
,
ipcSn
,
k
,
modGid
);
...
...
opencv-motion-detect/evmgr.cpp
浏览文件 @
670be3ac
...
@@ -63,7 +63,7 @@ private:
...
@@ -63,7 +63,7 @@ private:
string
daemonId
=
this
->
devSn
+
":evdaemon:0"
;
string
daemonId
=
this
->
devSn
+
":evdaemon:0"
;
if
(
peerId
==
daemonId
)
{
if
(
peerId
==
daemonId
)
{
if
(
metaValue
==
EV_MSG_META_VALUE_CMD_STOP
||
metaValue
==
EV_MSG_META_VALUE_CMD_RESTART
)
{
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
;
bProcessed
=
true
;
exit
(
0
);
exit
(
0
);
}
}
...
...
opencv-motion-detect/evmlmotion.cpp
浏览文件 @
670be3ac
...
@@ -970,7 +970,7 @@ public:
...
@@ -970,7 +970,7 @@ public:
exit
(
1
);
exit
(
1
);
}
}
spdlog
::
info
(
"evmlmotio {} boot"
,
selfId
);
spdlog
::
info
(
"evmlmotio
n
{} boot"
,
selfId
);
SingletonProcess
self
(
selfName
,
iid
);
SingletonProcess
self
(
selfName
,
iid
);
if
(
!
self
()){
if
(
!
self
()){
spdlog
::
error
(
"{} already running. ignore this instance"
,
selfId
);
spdlog
::
error
(
"{} already running. ignore this instance"
,
selfId
);
...
...
opencv-motion-detect/inc/zmqhelper.cpp
浏览文件 @
670be3ac
...
@@ -208,7 +208,7 @@ int forkSubsystem(string devSn, string peerId, int drPort, pid_t &pid){
...
@@ -208,7 +208,7 @@ int forkSubsystem(string devSn, string peerId, int drPort, pid_t &pid){
string
modName
=
v
[
1
];
string
modName
=
v
[
1
];
string
sn
=
v
[
0
];
string
sn
=
v
[
0
];
if
(
(
pid
=
fork
())
==
-
1
)
{
if
(
(
pid
=
fork
())
==
-
1
)
{
spdlog
::
error
(
"evdamon {} failed to fork subsytem
- evmgr"
,
devSn
);
spdlog
::
error
(
"evdamon {} failed to fork subsytem
: {}"
,
devSn
,
peerId
);
return
-
1
;
return
-
1
;
}
else
if
(
pid
==
0
)
{
}
else
if
(
pid
==
0
)
{
ret
+=
setenv
(
"PEERID"
,
peerId
.
c_str
(),
1
);
ret
+=
setenv
(
"PEERID"
,
peerId
.
c_str
(),
1
);
...
@@ -218,7 +218,7 @@ int forkSubsystem(string devSn, string peerId, int drPort, pid_t &pid){
...
@@ -218,7 +218,7 @@ int forkSubsystem(string devSn, string peerId, int drPort, pid_t &pid){
return
-
2
;
return
-
2
;
}
}
execl
((
string
(
"./"
)
+
modName
).
c_str
(),
NULL
,
NULL
,
NULL
);
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
{
}
else
{
// parent
// parent
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论