All of lore.kernel.org
 help / color / mirror / Atom feed
* Wireguard and wg-quick systemd unit location
@ 2020-07-10 12:11 luke
  2020-07-10 13:01 ` [OE-core] " Quentin Schulz
  0 siblings, 1 reply; 5+ messages in thread
From: luke @ 2020-07-10 12:11 UTC (permalink / raw)
  To: openembedded-core

Hi all,
I been learning how to run things lately and I think I've found a bug or
at least an unintended trap for new comers.

I've ran into exactly same issue as described here:
https://stackoverflow.com/questions/54197951/yocto-systemd-service-to-install-a-parameterized-service-service

After looking on how to work around the problem I also looked why it
given answer fails and why the heck it works for openvpn. The answer is
simple - wireguard leaves wq-quick@.service in /lib/systemd and not in
/lib/systemd/system. The end result is that any service which uses
SYSTEMD_SERVICE_${PN}=wireguard-tools + wg-quick@aaa.service doesn't work.

I've looked at other distros. In ubuntu and arch unit file is
/usr/lib/systemd/system hence it works as expected there. I've checked
rpm spec and unit is placed in invalid place:
%dir "/lib/systemd"
"/lib/systemd/wg-quick@.service"

I had a look on the wireguard makefile and it seems fine. Can someone
point me where issue comes from and give a tip how to patch this issue?

Kind regards,
Łukasz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] Wireguard and wg-quick systemd unit location
  2020-07-10 12:11 Wireguard and wg-quick systemd unit location luke
@ 2020-07-10 13:01 ` Quentin Schulz
  2020-07-10 13:04   ` Łukasz Dywicki
  0 siblings, 1 reply; 5+ messages in thread
From: Quentin Schulz @ 2020-07-10 13:01 UTC (permalink / raw)
  To: Łukasz Dywicki; +Cc: openembedded-core

Hi Łukasz,

On Fri, Jul 10, 2020 at 02:11:51PM +0200, Łukasz Dywicki wrote:
> Hi all,
> I been learning how to run things lately and I think I've found a bug or
> at least an unintended trap for new comers.
> 
> I've ran into exactly same issue as described here:
> https://stackoverflow.com/questions/54197951/yocto-systemd-service-to-install-a-parameterized-service-service
> 
> After looking on how to work around the problem I also looked why it
> given answer fails and why the heck it works for openvpn. The answer is
> simple - wireguard leaves wq-quick@.service in /lib/systemd and not in
> /lib/systemd/system. The end result is that any service which uses
> SYSTEMD_SERVICE_${PN}=wireguard-tools + wg-quick@aaa.service doesn't work.
> 

Can't comment on that, not familiar with systemd and the recipes
providing service units.

> I've looked at other distros. In ubuntu and arch unit file is
> /usr/lib/systemd/system hence it works as expected there. I've checked
> rpm spec and unit is placed in invalid place:
> %dir "/lib/systemd"
> "/lib/systemd/wg-quick@.service"
> 
> I had a look on the wireguard makefile and it seems fine. Can someone
> point me where issue comes from and give a tip how to patch this issue?
> 

If the path is the only issue
http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-kernel/wireguard/wireguard-tools_1.0.20200319.bb?h=master#n12
should probably be systemd_system_unitdir instead, c.f.:
http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/conf/bitbake.conf#n39

If this fixes it and there's no better answer in the next days, please
send a patch for that :)

Thanks,

Quentin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] Wireguard and wg-quick systemd unit location
  2020-07-10 13:01 ` [OE-core] " Quentin Schulz
@ 2020-07-10 13:04   ` Łukasz Dywicki
  2020-07-10 18:54     ` Łukasz Dywicki
  0 siblings, 1 reply; 5+ messages in thread
From: Łukasz Dywicki @ 2020-07-10 13:04 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: openembedded-core

Hi Quentin,
Indeed that looks like a valid root cause. I been looking on this make
call for two days and didn't notice the typo. Nice spot!

I will test patch to see if it helps. Expect patch for review. :-)

Best,
Łukasz

On 10.07.2020 15:01, Quentin Schulz wrote:
> Hi Łukasz,
> 
> On Fri, Jul 10, 2020 at 02:11:51PM +0200, Łukasz Dywicki wrote:
>> Hi all,
>> I been learning how to run things lately and I think I've found a bug or
>> at least an unintended trap for new comers.
>>
>> I've ran into exactly same issue as described here:
>> https://stackoverflow.com/questions/54197951/yocto-systemd-service-to-install-a-parameterized-service-service
>>
>> After looking on how to work around the problem I also looked why it
>> given answer fails and why the heck it works for openvpn. The answer is
>> simple - wireguard leaves wq-quick@.service in /lib/systemd and not in
>> /lib/systemd/system. The end result is that any service which uses
>> SYSTEMD_SERVICE_${PN}=wireguard-tools + wg-quick@aaa.service doesn't work.
>>
> 
> Can't comment on that, not familiar with systemd and the recipes
> providing service units.
> 
>> I've looked at other distros. In ubuntu and arch unit file is
>> /usr/lib/systemd/system hence it works as expected there. I've checked
>> rpm spec and unit is placed in invalid place:
>> %dir "/lib/systemd"
>> "/lib/systemd/wg-quick@.service"
>>
>> I had a look on the wireguard makefile and it seems fine. Can someone
>> point me where issue comes from and give a tip how to patch this issue?
>>
> 
> If the path is the only issue
> http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-kernel/wireguard/wireguard-tools_1.0.20200319.bb?h=master#n12
> should probably be systemd_system_unitdir instead, c.f.:
> http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/conf/bitbake.conf#n39
> 
> If this fixes it and there's no better answer in the next days, please
> send a patch for that :)
> 
> Thanks,
> 
> Quentin
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] Wireguard and wg-quick systemd unit location
  2020-07-10 13:04   ` Łukasz Dywicki
@ 2020-07-10 18:54     ` Łukasz Dywicki
  2020-07-13  9:29       ` Quentin Schulz
  0 siblings, 1 reply; 5+ messages in thread
From: Łukasz Dywicki @ 2020-07-10 18:54 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]

Given basic nature of the issue I was able to patch it quickly. It works
as expected. Thank you very much for the pointer.

I am not quite sure which channel is intended for sending patches. Shall
I create bugzilla entry for this one liner?

Cheers,
Łukasz

On 10.07.2020 15:04, Łukasz Dywicki wrote:
> Hi Quentin,
> Indeed that looks like a valid root cause. I been looking on this make
> call for two days and didn't notice the typo. Nice spot!
> 
> I will test patch to see if it helps. Expect patch for review. :-)
> 
> Best,
> Łukasz
> 
> On 10.07.2020 15:01, Quentin Schulz wrote:
>> Hi Łukasz,
>>
>> On Fri, Jul 10, 2020 at 02:11:51PM +0200, Łukasz Dywicki wrote:
>>> Hi all,
>>> I been learning how to run things lately and I think I've found a bug or
>>> at least an unintended trap for new comers.
>>>
>>> I've ran into exactly same issue as described here:
>>> https://stackoverflow.com/questions/54197951/yocto-systemd-service-to-install-a-parameterized-service-service
>>>
>>> After looking on how to work around the problem I also looked why it
>>> given answer fails and why the heck it works for openvpn. The answer is
>>> simple - wireguard leaves wq-quick@.service in /lib/systemd and not in
>>> /lib/systemd/system. The end result is that any service which uses
>>> SYSTEMD_SERVICE_${PN}=wireguard-tools + wg-quick@aaa.service doesn't work.
>>>
>>
>> Can't comment on that, not familiar with systemd and the recipes
>> providing service units.
>>
>>> I've looked at other distros. In ubuntu and arch unit file is
>>> /usr/lib/systemd/system hence it works as expected there. I've checked
>>> rpm spec and unit is placed in invalid place:
>>> %dir "/lib/systemd"
>>> "/lib/systemd/wg-quick@.service"
>>>
>>> I had a look on the wireguard makefile and it seems fine. Can someone
>>> point me where issue comes from and give a tip how to patch this issue?
>>>
>>
>> If the path is the only issue
>> http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-kernel/wireguard/wireguard-tools_1.0.20200319.bb?h=master#n12
>> should probably be systemd_system_unitdir instead, c.f.:
>> http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/conf/bitbake.conf#n39
>>
>> If this fixes it and there's no better answer in the next days, please
>> send a patch for that :)
>>
>> Thanks,
>>
>> Quentin
>>

[-- Attachment #2: 0003-fix-wrong-wgquick-systemd-unit-path.patch --]
[-- Type: text/x-patch, Size: 1382 bytes --]

From beaa3dd63269e6f480a1df30d4129031d886c355 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Dywicki?= <luke@code-house.org>
Date: Fri, 10 Jul 2020 17:13:55 +0200
Subject: [PATCH] Fix location for wq-quick@.service systemd unit.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

By default systemd looks for units in {etc,lib}/systemd/system.

Signed-off-by: Łukasz Dywicki <luke@code-house.org>
---
 .../recipes-kernel/wireguard/wireguard-tools_0.0.20190123.bb    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20190123.bb b/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20190123.bb
index c4ddbcb0e..02dc145c0 100644
--- a/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20190123.bb
+++ b/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20190123.bb
@@ -11,7 +11,7 @@ do_compile_prepend () {
 do_install () {
     cd ${S}/tools
     oe_runmake DESTDIR="${D}" PREFIX="${prefix}" SYSCONFDIR="${sysconfdir}" \
-        SYSTEMDUNITDIR="${systemd_unitdir}" \
+        SYSTEMDUNITDIR="${systemd_system_unitdir}" \
         WITH_SYSTEMDUNITS=${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', '', d)} \
         WITH_BASHCOMPLETION=yes \
         WITH_WGQUICK=yes \
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] Wireguard and wg-quick systemd unit location
  2020-07-10 18:54     ` Łukasz Dywicki
@ 2020-07-13  9:29       ` Quentin Schulz
  0 siblings, 0 replies; 5+ messages in thread
From: Quentin Schulz @ 2020-07-13  9:29 UTC (permalink / raw)
  To: Łukasz Dywicki; +Cc: openembedded-core

Hi Łukasz,

On Fri, Jul 10, 2020 at 08:54:36PM +0200, Łukasz Dywicki wrote:
> Given basic nature of the issue I was able to patch it quickly. It works
> as expected. Thank you very much for the pointer.
> 
> I am not quite sure which channel is intended for sending patches. Shall
> I create bugzilla entry for this one liner?
> 

Please send a patch since you already have the solution to your bug :)

https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
should give you enough pointers. Should you struggle with it, let us
know, that means the doc can be improved.

Cheers,
Quentin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-13  9:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 12:11 Wireguard and wg-quick systemd unit location luke
2020-07-10 13:01 ` [OE-core] " Quentin Schulz
2020-07-10 13:04   ` Łukasz Dywicki
2020-07-10 18:54     ` Łukasz Dywicki
2020-07-13  9:29       ` Quentin Schulz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.