Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B42B1E00843; Wed, 14 Mar 2018 15:20:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, MANY_SPAN_IN_TEXT,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [64.235.154.221 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 1.0 MANY_SPAN_IN_TEXT Many tags embedded within text Received: from 14pmail.ess.barracuda.com (14pmail.ess.barracuda.com [64.235.154.221]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4682FE00474 for ; Wed, 14 Mar 2018 15:20:02 -0700 (PDT) Received: from SFAMAIL.SAKURAUS.LOCAL (mail.sakuraus.com [12.26.104.5]) by mx1401.ess.rzc.cudaops.com (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NO); Wed, 14 Mar 2018 22:19:57 +0000 Received: from SFAMAIL.SAKURAUS.LOCAL (10.16.3.8) by SFAMAIL.SAKURAUS.LOCAL (10.16.3.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 14 Mar 2018 15:04:24 -0700 Received: from SFAMAIL.SAKURAUS.LOCAL ([::1]) by SFAMAIL.SAKURAUS.LOCAL ([::1]) with mapi id 15.01.0669.032; Wed, 14 Mar 2018 15:04:24 -0700 From: Greg Wilson-Lindberg To: Jeremy Thien Thread-Topic: [yocto] trouble getting systemd oneshot to run Thread-Index: AQHTu8SR04VV/wWOvUyTMDytB670GaPQnlgA//+m/08= Date: Wed, 14 Mar 2018 22:04:24 +0000 Message-ID: <7d6a04f438314656ad26b1c0b764f3e9@sakuraus.com> References: , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.16.5.239] MIME-Version: 1.0 X-BESS-ID: 1521065993-321457-11912-9240-2 X-BESS-VER: 2018.2-r1803082101 X-BESS-Apparent-Source-IP: 12.26.104.5 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.191064 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_SC0_MISMATCH_TO META: Envelope rcpt doesn' t match header 0.00 HTML_MESSAGE BODY: HTML included in message 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS29408 scores of KILL_LEVEL=7.0 tests=BSF_SC0_MISMATCH_TO, HTML_MESSAGE, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Cc: "yocto@yoctoproject.org" Subject: Re: trouble getting systemd oneshot to run X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 22:20:03 -0000 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_7d6a04f438314656ad26b1c0b764f3e9sakurauscom_" --_000_7d6a04f438314656ad26b1c0b764f3e9sakurauscom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I changed it to look like: PACKAGES +=3D "${PN}-service" FILES_${PN} =3D "${datadir}/*" FILES_${PN}-service =3D "${systemd_system_unitdir}/canstart.service" do_install () { if test -e ${WORKDIR}/can_start.sh && test -e ${WORKDIR}/canstart.service; then install -d ${D}${datadir}/canstart install -m 0755 ${WORKDIR}/can_start.sh ${D}${datadir}/canstart install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/canstart.service ${D}${systemd_system_un= itdir} sed -i -e 's|@SCRIPTDIR@|${datadir}/canstart|g' ${D}${systemd_syste= m_unitdir}/canstart.service fi } SYSTEMD_PACKAGES =3D "${PN}-service" SYSTEMD_SERVICE_${PN}-service =3D "canstart.service" SYSTEMD_AUTO_ENABLE_${PN}-service =3D "enable" Still got the same results, my task is not running at startup. To make sure that there wasn't some problem in running the script, I change= d the ExecStart to echo to a file in /tmp. Nothing there. The .service file= is not being executed. I've obviously got something totally messed up, but I'm darned if I underst= and what it is. ________________________________ From: Jeremy Thien Sent: Wednesday, March 14, 2018 1:08 PM To: Greg Wilson-Lindberg Cc: yocto@yoctoproject.org Subject: Re: [yocto] trouble getting systemd oneshot to run I am no expert, but I have a similar recipe. It might be over complicated, = but I put the script in one package and the service in another something li= ke: PACKAGES +=3D "${PN}-service" FILES_${PN} =3D "${datadir}/canstart/canstart.sh " FILES_${PN}-service =3D "${systemd_unitdir}/system/canstart.service " SYSTEMD_PACKAGES =3D ${PN}-service" SYSTEMD_SERVICE_${PN}-service =3D canstart.service" SYSTEMD_AUTO_ENABLE_${PN}-service =3D "enable" Of course, this requires image to install both canstart and canstart-servic= e. Hope this helps, Jeremy Thien On Wed, Mar 14, 2018 at 3:21 PM Greg Wilson-Lindberg > wrote: I'm building yocto for a raspberry pi3 from Qt's b2qt version. I'm running into two problems, I've got all of the files copying to the cor= rect locations but the .service is not running at startup. I used connman-c= onf.bb as the template for my .bb file: SUMMARY=3D"recipe to create CAN bus startup service" LICENSE =3D "CLOSED" LIC_FILES_CHKSUM =3D "" inherit systemd SRC_URI =3D "file://can_start.sh \ file://canstart.service \ " S =3D "${WORKDIR}" PACKAGE_ARCH =3D "${MACHINE_ARCH}" FILES_${PN} =3D "${datadir}/*" do_install () { if test -e ${WORKDIR}/can_start.sh && test -e ${WORKDIR}/canstart.service; then install -d ${D}${datadir}/canstart install -m 0755 ${WORKDIR}/can_start.sh ${D}${datadir}/canstart install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/canstart.service ${D}${systemd_system_un= itdir} sed -i -e 's|@SCRIPTDIR@|${datadir}/canstart|g' ${D}${systemd_syste= m_unitdir}/canstart.service fi } SYSTEMD_SERVICE_${PN} =3D "canstart.service" Service file: [Unit] Description=3DStartup CAN bus interface [Service] Type=3Doneshot ExecStart=3D@SCRIPTDIR@/can_start.sh [Install] WantedBy=3Dnetwork.target From looking at the connman-conf sample I'm setting everything up correctly= and the service should default to running on startup but it is not. The second 'problem' is really just perplexing, if I dump the variables S c= ontains a path to a directory in my root not "${WORKDIR}". Any and all help with this would be greatly appreciated. Regards, Greg Wilson-Lindberg -- _______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto -- Jeremy Thien Director of Engineering | Adtec Digital jeremy.thien@adtecdigital.net | mobil= e: +1 (904) 910-1749 --_000_7d6a04f438314656ad26b1c0b764f3e9sakurauscom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

I changed it to look like:

PACKAGES +=3D "${PN}-service"=0A=
=0A=
FILES_${PN} =3D "${datadir}/*"=0A=
FILES_${PN}-service =3D "${systemd_system_unitdir}/canstart.service"<=
/span>=0A=
=0A=
do_install () {=0A=
    if test -e ${WORKDIR}/can_start<=
span style=3D"color:#800000;">.sh &&=0A=
       test -e ${WORKDIR}/canstart.service; then=0A=
        install -d ${D}${datadir}/canstart=0A=
        install -m 0755 ${WORKDIR}/=
can_start.sh ${D}${datadir}/canstar=
t=0A=
        install -d ${D}${systemd_sys=
tem_unitdir}=0A=
        install -m 0644 ${WORKDIR}/=
canstart.service ${D}${systemd_system_unitdir}=0A=
        sed -i -e 's|@SCRIPTDIR@|${datadir}/=
canstart|g' ${D}${systemd_sys=
tem_unitdir}/canstart.service=0A=
    fi=0A=
}=0A=

SYSTEMD_PACKAGES =3D "${PN}-service"=0A=
SYSTEMD_SERVICE_${PN}-service =3D "canstart.service"=0A=
SYSTEMD_AUTO_ENABLE_${PN}-service =3D "enable"=0A=
=0A=
Still got the same results, my task is not running at startup.
To make sure that there wasn't some problem in running the script, I c= hanged the ExecStart to echo to a file in /tmp. Nothing there. The .service= file is not being executed.
I've obviously got something totally messed up, but I'm darned if I underst= and what it is.



From: Jeremy Thien <jere= myt@adtecinc.com>
Sent: Wednesday, March 14, 2018 1:08 PM
To: Greg Wilson-Lindberg
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] trouble getting systemd oneshot to run
 
I am no expert, but I have a similar recipe. It might be o= ver complicated, but I put the script in one package and the service in ano= ther something like:

PACKAGES +=3D "${PN}-service"
FILES_${PN} =3D "${datadir}/canstart/canstart.sh "
FILES_${PN}-service =3D "${systemd_unitdir}/system/canstart.servi= ce "
SYSTEMD_PACKAGES =3D ${PN}-service"
SYSTEMD_SERVICE_${PN}-service =3D canstart.service"
SYSTEMD_AUTO_ENABLE_${PN}-service =3D "enable"

Of course, this requires image to install both canstart and canstart-s= ervice.

Hope this helps,
Jeremy Thien

On Wed, Mar 14, 2018 at 3:21 PM Greg Wilson-Lindberg <<= a href=3D"mailto:GWilson@sakuraus.com">GWilson@sakuraus.com> wrote:<= br>

I'm building yocto for a raspberry pi3 from Qt's b2qt version.


I'm running into two problems, I've got all of the files copying to the = correct locations but the .service is not running at startup. I used connman-conf.bb as= the template for my .bb file:


SUMMARY=3D"recipe to create CAN bus startup service"=0A=
=0A=
LICENSE =3D "CLOSED"=0A=
LIC_FILES_CHKSUM =3D ""=0A=
=0A=
inherit systemd=0A=
=0A=
SRC_URI =3D "file://can_start.sh \=0A=
           file://canstart.service \=
=0A=
"=0A=
=0A=
S =3D &q=
uot;${WORKDIR}"=0A=
=0A=
PACKAGE_ARCH =3D "${MACHINE_ARCH}"=0A=
=0A=
FILES_${PN} =3D "${datadir}/*"=0A=
=0A=
do_install () {=0A=
    if test -e ${WORKDIR}/can_start.sh &&=0A=
       test -e ${WORKDIR}/canstart.serv=
ice; then=0A=
        install -d ${D}${datadir}/canstart=0A=
        install -m 0755 ${WORKDIR}/ca=
n_start.sh ${D}${datadir}/canstart=0A=
        install -d ${D}${systemd_system=
_unitdir}=0A=
        install -m 0644 ${WORKDIR}/ca=
nstart.service ${D}${systemd_system_unitdir}=0A=
        sed -i -e 's|@SCRIPTDIR@|${datadir}/c=
anstart|g' ${D}${systemd_system_=
unitdir}/canstart.service=0A=
    fi=0A=
}=0A=
=0A=
SYSTEMD_SERVICE_${PN} =3D "canstart.service"=0A=

Service file:
=0A=
[Unit]=0A=
Description=3DStartup CAN bus interface=0A=
=0A=
[Service]=0A=
Type=3Doneshot=0A=
ExecStart=3D@SCRIPTDIR@/can_start.sh=0A=
=0A=
[Install]=0A=
WantedBy=3Dnetwork.target=0A=

From lo= oking at the connman-conf sample I'm setting everything up correctly and th= e service should default to running on startup but it is not.

The second 'problem' is really just perplexing, if I dump the variables S c= ontains a path to a directory in my root not 
"${= WORKDIR}".

Any and all help with this would be greatly appreciated.


Regards,

Greg Wilson-Lindberg

--
_______________________________________________
yocto mailing list
yocto@yoctoproj= ect.org
https://lists.yoctoproject.org/listinfo/yocto
--
Jeremy Thien
Director of Engineering | Adtec Digital
jeremy.thien@adtecdig= ital.net | mobile: +1 (904) 910-1749
--_000_7d6a04f438314656ad26b1c0b764f3e9sakurauscom_--