Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
meta-soleil-fofb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DG
FOFB
meta-soleil-fofb
Commits
3e56feb3
Commit
3e56feb3
authored
1 year ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
fix(opcua): Start deamon exit when server fails to start
parent
a85f12dd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
recipes-app/fofb-opcua-server/files/fofb-opcua-server.sh
+25
-8
25 additions, 8 deletions
recipes-app/fofb-opcua-server/files/fofb-opcua-server.sh
with
25 additions
and
8 deletions
recipes-app/fofb-opcua-server/files/fofb-opcua-server.sh
+
25
−
8
View file @
3e56feb3
...
...
@@ -23,16 +23,33 @@ start() {
echo
"starting"
>
$LOCK_FILE
stdbuf
-oL
opcua-generic-chimeratk-server01 &>>
$LOG_FILE
&
# Wait for server started
(
tail
-F
-n0
$LOG_FILE
&
)
|
grep
-q
"All application modules are running"
(
tail
-F
-n0
$LOG_FILE
&
)
|
grep
-q
"ChimeraTK::logic_error"
&&
(
echo
"crashed"
>
$LOCK_FILE
)
&
(
tail
-F
-n0
$LOG_FILE
&
)
|
grep
-q
"All application modules are running"
&&
(
echo
"started"
>
$LOCK_FILE
)
&
# Restart FPGA application because server writes all zeros
echo
"Restart FPGA application"
>>
$LOG_FILE
/etc/init.d/fofb-init.sh start
# Wait for server started or crashed
while
:
do
state
=
$(
cat
$LOCK_FILE
)
if
[
"
$state
"
=
"started"
]
;
then
# Reset the FPGA
echo
"Init again application"
>>
$LOG_FILE
/etc/init.d/fofb-init.sh start
>>
$LOG_FILE
success
break
fi
if
[
"
$state
"
=
"crashed"
]
;
then
failure
break
fi
sleep
1
done
kill
$(
jobs
-p
)
### Create the lock file ###
echo
"started"
>
$LOCK_FILE
success
$"fofb-opcua server startup"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment