Skip to contentSkip to conversation

nuttcp: add systemd unit file

PATCH In review Oleksandr Kravchuk 2 participants 4 messages Jun 23, 2019 – Jun 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nuttcp: add systemd unit file

---
 .../recipes-support/nuttcp/nuttcp/nuttcp.socket      |  9 +++++++++
 .../recipes-support/nuttcp/nuttcp/[email protected]    |  8 ++++++++
 .../recipes-support/nuttcp/nuttcp_8.2.2.bb           | 12 +++++++++++-
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/[email protected]
meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket new file +9 -0
new file mode 100644
index 000000000..a8ae74fb8
@@ -0,0 +1,9 @@
+[Unit]
+Description=Network Performance Testing Server Activation Socket
+
+[Socket]
+ListenStream=5000
+Accept=true
+
+[Install]
+WantedBy=sockets.target
meta-networking/recipes-support/nuttcp/nuttcp/[email protected] new file +8 -0
new file mode 100644
index 000000000..b778e8552
@@ -0,0 +1,8 @@
+[Unit]
+Description=Network Performance Testing Server
+After=local-fs.target
+
+[Service]
+User=nobody
+ExecStart=/usr/bin/nuttcp -S
+StandardInput=socket
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +11 -1
index 2fd563123..193caf3cf 100644
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=496a7c0bb83c07ff52
 
 UPSTREAM_CHECK_URI = "https://www.nuttcp.net/nuttcp/beta/"
 
-SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c"
+SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c \
+           file://[email protected] \
+           file://nuttcp.socket"
 SRC_URI[md5sum] = "d3c92c4d2f261221193c3726c1b9a42f"
 SRC_URI[sha256sum] = "8c5595bcd27c2fd66831be74c390df078cfb1870aa427f2511ac2586d236c8a1"
 
@@ -24,5 +26,13 @@ do_compile () {
 
 do_install () {
     install -d ${D}${bindir}
+    install -d ${D}${systemd_system_unitdir}
     install -m 0755 nuttcp ${D}${bindir}
+    install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/nuttcp.socket ${D}${systemd_system_unitdir}
 }
+
+FILES_${PN} += " \
+    ${bindir} \
+    ${systemd_system_unitdir} \
+"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 44 lines · Oleksandr Kravchuk
---
 .../recipes-support/nuttcp/nuttcp/nuttcp.socket      |  9 +++++++++
 .../recipes-support/nuttcp/nuttcp/[email protected]    |  8 ++++++++
 .../recipes-support/nuttcp/nuttcp_8.2.2.bb           | 12 +++++++++++-
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/[email protected]
meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket new file +9 -0
new file mode 100644
index 000000000..a8ae74fb8
@@ -0,0 +1,9 @@
+[Unit]
+Description=Network Performance Testing Server Activation Socket
+
+[Socket]
+ListenStream=5000
+Accept=true
+
+[Install]
+WantedBy=sockets.target
meta-networking/recipes-support/nuttcp/nuttcp/[email protected] new file +8 -0
new file mode 100644
index 000000000..b778e8552
@@ -0,0 +1,8 @@
+[Unit]
+Description=Network Performance Testing Server
+After=local-fs.target
+
+[Service]
+User=nobody
+ExecStart=/usr/bin/nuttcp -S
+StandardInput=socket
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +0 -0
index 2fd563123..193caf3cf 100644

meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=496a7c0bb83c07ff52 · line 20

Quoted 10 lines
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +3 -1
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=496a7c0bb83c07ff52
 
 UPSTREAM_CHECK_URI = "https://www.nuttcp.net/nuttcp/beta/"
 
-SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c"
+SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c \
+           file://[email protected] \
+           file://nuttcp.socket"
 SRC_URI[md5sum] = "d3c92c4d2f261221193c3726c1b9a42f"
 SRC_URI[sha256sum] = "8c5595bcd27c2fd66831be74c390df078cfb1870aa427f2511ac2586d236c8a1"
 

I think we also need to inherit systemd bbclass,

Quoted 22 lines
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +8 -1
@@ -24,5 +26,13 @@ do_compile () {
 
 do_install () {
     install -d ${D}${bindir}
+    install -d ${D}${systemd_system_unitdir}
     install -m 0755 nuttcp ${D}${bindir}
+    install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/nuttcp.socket ${D}${systemd_system_unitdir}
 }
+
+FILES_${PN} += " \
+    ${bindir} \
+    ${systemd_system_unitdir} \
+"
--

2.17.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#2 lore raw

I thought the same. I am not sure how this is supposed to work, but when I add inherit systemd, unit files do not end up in the package.

Quoted 79 lines · Khem Raj
Quoted 43 lines · Oleksandr Kravchuk
---
 .../recipes-support/nuttcp/nuttcp/nuttcp.socket      |  9 +++++++++
 .../recipes-support/nuttcp/nuttcp/[email protected]    |  8 ++++++++
 .../recipes-support/nuttcp/nuttcp_8.2.2.bb           | 12 +++++++++++-
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/[email protected]
meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket new file +9 -0
new file mode 100644
index 000000000..a8ae74fb8
@@ -0,0 +1,9 @@
+[Unit]
+Description=Network Performance Testing Server Activation Socket
+
+[Socket]
+ListenStream=5000
+Accept=true
+
+[Install]
+WantedBy=sockets.target
meta-networking/recipes-support/nuttcp/nuttcp/[email protected] new file +8 -0
new file mode 100644
index 000000000..b778e8552
@@ -0,0 +1,8 @@
+[Unit]
+Description=Network Performance Testing Server
+After=local-fs.target
+
+[Service]
+User=nobody
+ExecStart=/usr/bin/nuttcp -S
+StandardInput=socket
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +0 -0
index 2fd563123..193caf3cf 100644

meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=496a7c0bb83c07ff52 · line 20

Quoted 10 lines
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +3 -1
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=496a7c0bb83c07ff52
 
 UPSTREAM_CHECK_URI = "https://www.nuttcp.net/nuttcp/beta/"
 
-SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c"
+SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c \
+           file://[email protected] \
+           file://nuttcp.socket"
 SRC_URI[md5sum] = "d3c92c4d2f261221193c3726c1b9a42f"
 SRC_URI[sha256sum] = "8c5595bcd27c2fd66831be74c390df078cfb1870aa427f2511ac2586d236c8a1"
 

I think we also need to inherit systemd bbclass,

Quoted 22 lines
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +8 -1
@@ -24,5 +26,13 @@ do_compile () {
 
 do_install () {
     install -d ${D}${bindir}
+    install -d ${D}${systemd_system_unitdir}
     install -m 0755 nuttcp ${D}${bindir}
+    install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/nuttcp.socket ${D}${systemd_system_unitdir}
 }
+
+FILES_${PN} += " \
+    ${bindir} \
+    ${systemd_system_unitdir} \
+"
--

2.17.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#3 lore raw
Quoted 4 lines · Oleksandr Kravchuk

I thought the same. I am not sure how this is supposed to work, but when I add inherit systemd, unit files do not end up in the package.

you still need to install them in right location but this class will then do the right post install steps etc.

Quoted 80 lines · Khem Raj
Quoted 79 lines
Quoted 43 lines · Oleksandr Kravchuk
---
 .../recipes-support/nuttcp/nuttcp/nuttcp.socket      |  9 +++++++++
 .../recipes-support/nuttcp/nuttcp/[email protected]    |  8 ++++++++
 .../recipes-support/nuttcp/nuttcp_8.2.2.bb           | 12 +++++++++++-
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket
 create mode 100644 meta-networking/recipes-support/nuttcp/nuttcp/[email protected]
meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket new file +9 -0
new file mode 100644
index 000000000..a8ae74fb8
@@ -0,0 +1,9 @@
+[Unit]
+Description=Network Performance Testing Server Activation Socket
+
+[Socket]
+ListenStream=5000
+Accept=true
+
+[Install]
+WantedBy=sockets.target
meta-networking/recipes-support/nuttcp/nuttcp/[email protected] new file +8 -0
new file mode 100644
index 000000000..b778e8552
@@ -0,0 +1,8 @@
+[Unit]
+Description=Network Performance Testing Server
+After=local-fs.target
+
+[Service]
+User=nobody
+ExecStart=/usr/bin/nuttcp -S
+StandardInput=socket
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +0 -0
index 2fd563123..193caf3cf 100644

meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=496a7c0bb83c07ff52 · line 20

Quoted 10 lines
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +3 -1
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=496a7c0bb83c07ff52
 
 UPSTREAM_CHECK_URI = "https://www.nuttcp.net/nuttcp/beta/"
 
-SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c"
+SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c \
+           file://[email protected] \
+           file://nuttcp.socket"
 SRC_URI[md5sum] = "d3c92c4d2f261221193c3726c1b9a42f"
 SRC_URI[sha256sum] = "8c5595bcd27c2fd66831be74c390df078cfb1870aa427f2511ac2586d236c8a1"
 

I think we also need to inherit systemd bbclass,

Quoted 22 lines
meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb +8 -1
@@ -24,5 +26,13 @@ do_compile () {
 
 do_install () {
     install -d ${D}${bindir}
+    install -d ${D}${systemd_system_unitdir}
     install -m 0755 nuttcp ${D}${bindir}
+    install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/nuttcp.socket ${D}${systemd_system_unitdir}
 }
+
+FILES_${PN} += " \
+    ${bindir} \
+    ${systemd_system_unitdir} \
+"
--

2.17.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel