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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DG
FOFB
meta-soleil-fofb
Commits
148d6c39
Commit
148d6c39
authored
2 years ago
by
BRONES Romain
Browse files
Options
Downloads
Patches
Plain Diff
feat(opcua):Add init.d startup script
parent
dca0a4fc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
recipes-app/fofb-opcua-server/files/fofb-opcua-server.sh
+56
-0
56 additions, 0 deletions
recipes-app/fofb-opcua-server/files/fofb-opcua-server.sh
recipes-app/fofb-opcua-server/fofb-opcua-server_0.1.bb
+12
-1
12 additions, 1 deletion
recipes-app/fofb-opcua-server/fofb-opcua-server_0.1.bb
with
68 additions
and
1 deletion
recipes-app/fofb-opcua-server/files/fofb-opcua-server.sh
0 → 100755
+
56
−
0
View file @
148d6c39
#!/bin/bash
.
/etc/init.d/functions
LOG_FILE
=
/var/log/fofb-opcua-server.log
LOCK_FILE
=
/var/lock/subsys/fofb-opcua-server.log
# Start the service
start
()
{
if
[
-f
$LOCK_FILE
]
;
then
echo
"fofb-opcua server already running"
exit
1
fi
echo
"Starting fofb-opcua-server"
>>
$LOG_FILE
cd
/opt/fofb-opcua-server
stdbuf
-oL
opcua-generic-chimeratk-server01 &>>
$LOG_FILE
&
### Create the lock file ###
touch
$LOCK_FILE
success
$"fofb-opcua server startup"
}
# Restart the service
stop
()
{
echo
"Stopping fofb-opcua-server"
>>
$LOG_FILE
killproc opcua-generic-chimeratk-server01
### Now, delete the lock file ###
rm
-f
$LOCK_FILE
}
### main logic ###
case
"
$1
"
in
start
)
start
;;
stop
)
stop
;;
status
)
status opcua-generic-chimeratk-server01
;;
restart|reload|condrestart
)
stop
start
;;
*
)
echo
$"Usage:
$0
{start|stop|restart|reload|status}"
exit
1
esac
exit
0
This diff is collapsed.
Click to expand it.
recipes-app/fofb-opcua-server/fofb-opcua-server_0.1.bb
+
12
−
1
View file @
148d6c39
...
...
@@ -3,14 +3,22 @@ SECTION = "opt"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# This will add startup scripts
INITSCRIPT_NAME = "fofb-opcua-server.sh"
INITSCRIPT_PARAMS = "defaults 91"
inherit update-rc.d
SRC_URI = " file://app.mapt \
file://devices.dmap \
file://generic_chimeratk_server_configuration.xml \
file://fofb-opcua-server.sh \
"
RDEPENDS_${PN}=" genericdeviceserver-opcua"
RDEPENDS_${PN}=" genericdeviceserver-opcua
bash
"
FILES_${PN}+="/opt/fofb-opcua-server/*"
FILES_${PN}+="/etc/init.d/fofb-opcua-server.sh"
do_compile() {
# Replace BAR by 0
...
...
@@ -22,4 +30,7 @@ do_install() {
install -m 0644 ${WORKDIR}/app_bar0.mapt ${D}/opt/fofb-opcua-server/app.mapt
install -m 0644 ${WORKDIR}/devices.dmap ${D}/opt/fofb-opcua-server/devices.dmap
install -m 0644 ${WORKDIR}/generic_chimeratk_server_configuration.xml ${D}/opt/fofb-opcua-server/generic_chimeratk_server_configuration.xml
install -d ${D}/etc/init.d/
install -m 0755 ${WORKDIR}/fofb-opcua-server.sh ${D}/etc/init.d/fofb-opcua-server.sh
}
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