[oe] [PATCH][meta-networking] nuttcp: add systemd unit file

Oleksandr Kravchuk open.source at oleksandr-kravchuk.com
Mon Jun 24 18:03:40 UTC 2019


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.

On 24/06/2019 02:54, Khem Raj wrote:
> On Sun, Jun 23, 2019 at 3:36 PM Oleksandr Kravchuk
> <open.source at oleksandr-kravchuk.com> wrote:
>> Signed-off-by: Oleksandr Kravchuk <open.source at oleksandr-kravchuk.com>
>> ---
>>  .../recipes-support/nuttcp/nuttcp/nuttcp.socket      |  9 +++++++++
>>  .../recipes-support/nuttcp/nuttcp/nuttcp at .service    |  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/nuttcp at .service
>>
>> diff --git a/meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket b/meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket
>> new file mode 100644
>> index 000000000..a8ae74fb8
>> --- /dev/null
>> +++ b/meta-networking/recipes-support/nuttcp/nuttcp/nuttcp.socket
>> @@ -0,0 +1,9 @@
>> +[Unit]
>> +Description=Network Performance Testing Server Activation Socket
>> +
>> +[Socket]
>> +ListenStream=5000
>> +Accept=true
>> +
>> +[Install]
>> +WantedBy=sockets.target
>> diff --git a/meta-networking/recipes-support/nuttcp/nuttcp/nuttcp at .service b/meta-networking/recipes-support/nuttcp/nuttcp/nuttcp at .service
>> new file mode 100644
>> index 000000000..b778e8552
>> --- /dev/null
>> +++ b/meta-networking/recipes-support/nuttcp/nuttcp/nuttcp at .service
>> @@ -0,0 +1,8 @@
>> +[Unit]
>> +Description=Network Performance Testing Server
>> +After=local-fs.target
>> +
>> +[Service]
>> +User=nobody
>> +ExecStart=/usr/bin/nuttcp -S
>> +StandardInput=socket
>> diff --git a/meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb b/meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb
>> index 2fd563123..193caf3cf 100644
>> --- a/meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb
>> +++ b/meta-networking/recipes-support/nuttcp/nuttcp_8.2.2.bb
>> @@ -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://nuttcp@.service \
>> +           file://nuttcp.socket"
>>  SRC_URI[md5sum] = "d3c92c4d2f261221193c3726c1b9a42f"
>>  SRC_URI[sha256sum] = "8c5595bcd27c2fd66831be74c390df078cfb1870aa427f2511ac2586d236c8a1"
>>
> I think we also need to inherit systemd bbclass,
>
>> @@ -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}/nuttcp at .service ${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
>> Openembedded-devel at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


More information about the Openembedded-devel mailing list