All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-webserver][PATCH] meta-webserver: apache2 allow SYSTEMD_AUTO_ENABLE to be overwritten
@ 2017-11-16 15:19 Mark Asselstine
  2017-11-16 18:28 ` Patrick Ohly
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Asselstine @ 2017-11-16 15:19 UTC (permalink / raw)
  To: openembedded-devel

The current assignment does not allow a bbappend to be used to
overwrite the SYSTEMD_AUTO_ENABLE value in order to have apache2 auto
start. You would have to resort to 'manually' creating a link in
do_install or a postinst. Using the '?=' assignment will correct this.

One might argue that if apache2 is being installed it would be
desirable to have it auto run, so this setting should be removed in
favor of the default in systemd.bbclass (enable). In order not to
surprise users of this recipe with this change in behavior we opt to
keep this as disabled but overwrite-able.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 meta-webserver/recipes-httpd/apache2/apache2_2.4.29.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-webserver/recipes-httpd/apache2/apache2_2.4.29.bb b/meta-webserver/recipes-httpd/apache2/apache2_2.4.29.bb
index f0298b9..60fc411 100644
--- a/meta-webserver/recipes-httpd/apache2/apache2_2.4.29.bb
+++ b/meta-webserver/recipes-httpd/apache2/apache2_2.4.29.bb
@@ -32,7 +32,7 @@ S = "${WORKDIR}/httpd-${PV}"
 inherit autotools update-rc.d pkgconfig systemd
 
 SYSTEMD_SERVICE_${PN} = "apache2.service"
-SYSTEMD_AUTO_ENABLE_${PN} = "disable"
+SYSTEMD_AUTO_ENABLE_${PN} ?= "disable"
 
 SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
 
-- 
2.7.4



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

* Re: [meta-webserver][PATCH] meta-webserver: apache2 allow SYSTEMD_AUTO_ENABLE to be overwritten
  2017-11-16 15:19 [meta-webserver][PATCH] meta-webserver: apache2 allow SYSTEMD_AUTO_ENABLE to be overwritten Mark Asselstine
@ 2017-11-16 18:28 ` Patrick Ohly
  2017-11-16 20:00   ` Mark Asselstine
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Ohly @ 2017-11-16 18:28 UTC (permalink / raw)
  To: Mark Asselstine, openembedded-devel

On Thu, 2017-11-16 at 10:19 -0500, Mark Asselstine wrote:
> The current assignment does not allow a bbappend to be used to
> overwrite the SYSTEMD_AUTO_ENABLE value in order to have apache2 auto
> start.

Why does SYSTEMD_AUTO_ENABLE_${PN} = "enable" in a apache2_*.bb not
work? It works fine for me with wpa-supplicant:

wpa-supplicant_2.6.bb: SYSTEMD_AUTO_ENABLE = "disable"
wpa-supplicant_2.6.bbappend: SYSTEMD_AUTO_ENABLE = "enable"
=> bitbake -e shows "enable"

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.




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

* Re: [meta-webserver][PATCH] meta-webserver: apache2 allow SYSTEMD_AUTO_ENABLE to be overwritten
  2017-11-16 18:28 ` Patrick Ohly
@ 2017-11-16 20:00   ` Mark Asselstine
  2017-11-16 22:14     ` Patrick Ohly
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Asselstine @ 2017-11-16 20:00 UTC (permalink / raw)
  To: Patrick Ohly; +Cc: openembedded-devel

On Thursday, November 16, 2017 7:28:06 PM EST Patrick Ohly wrote:
> On Thu, 2017-11-16 at 10:19 -0500, Mark Asselstine wrote:
> > The current assignment does not allow a bbappend to be used to
> > overwrite the SYSTEMD_AUTO_ENABLE value in order to have apache2 auto
> > start.
> 
> Why does SYSTEMD_AUTO_ENABLE_${PN} = "enable" in a apache2_*.bb not
> work? It works fine for me with wpa-supplicant:

Sorry. You are correct the bbappend will overwrite it, but this requires a 
bbappend. If this used "?=" you could achieve this in a local.conf or similar. 
In general if there is a possibility for a value to be desireable to overwrite 
using "?=" makes sense. Thoughts?

Mark


> 
> wpa-supplicant_2.6.bb: SYSTEMD_AUTO_ENABLE = "disable"
> wpa-supplicant_2.6.bbappend: SYSTEMD_AUTO_ENABLE = "enable"
> => bitbake -e shows "enable"




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

* Re: [meta-webserver][PATCH] meta-webserver: apache2 allow SYSTEMD_AUTO_ENABLE to be overwritten
  2017-11-16 20:00   ` Mark Asselstine
@ 2017-11-16 22:14     ` Patrick Ohly
  2017-11-20 23:02       ` Mark Asselstine
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Ohly @ 2017-11-16 22:14 UTC (permalink / raw)
  To: Mark Asselstine; +Cc: openembedded-devel

On Thu, 2017-11-16 at 15:00 -0500, Mark Asselstine wrote:
> On Thursday, November 16, 2017 7:28:06 PM EST Patrick Ohly wrote:
> > On Thu, 2017-11-16 at 10:19 -0500, Mark Asselstine wrote:
> > > The current assignment does not allow a bbappend to be used to
> > > overwrite the SYSTEMD_AUTO_ENABLE value in order to have apache2
> > > auto
> > > start.
> > 
> > Why does SYSTEMD_AUTO_ENABLE_${PN} = "enable" in a apache2_*.bb not
> > work? It works fine for me with wpa-supplicant:
> 
> Sorry. You are correct the bbappend will overwrite it, but this
> requires a bbappend. If this used "?=" you could achieve this in a
> local.conf or similar. 

SYSTEMD_AUTO_ENABLE_pn-wpa-supplicant = "enable" in local.conf also
overrides the = assignment in the .bb file.

> In general if there is a possibility for a value to be desireable to
> overwrite using "?=" makes sense. Thoughts?

I thought the same for a while, but since then I've come around to the
interpretation that for recipe-specific variables, using =? is mostly
just a cosmetic thing. I can't think of a good example where it really
matters in practice.

It's different for global variables which might get set prior to
parsing a recipe (distro config, local.conf). There it makes sense to
not overwrite a potentially existing value.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.




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

* Re: [meta-webserver][PATCH] meta-webserver: apache2 allow SYSTEMD_AUTO_ENABLE to be overwritten
  2017-11-16 22:14     ` Patrick Ohly
@ 2017-11-20 23:02       ` Mark Asselstine
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Asselstine @ 2017-11-20 23:02 UTC (permalink / raw)
  To: Patrick Ohly; +Cc: openembedded-devel

On Thursday, November 16, 2017 5:14:02 PM EST Patrick Ohly wrote:
> On Thu, 2017-11-16 at 15:00 -0500, Mark Asselstine wrote:
> > On Thursday, November 16, 2017 7:28:06 PM EST Patrick Ohly wrote:
> > > On Thu, 2017-11-16 at 10:19 -0500, Mark Asselstine wrote:
> > > > The current assignment does not allow a bbappend to be used to
> > > > overwrite the SYSTEMD_AUTO_ENABLE value in order to have apache2
> > > > auto
> > > > start.
> > > 
> > > Why does SYSTEMD_AUTO_ENABLE_${PN} = "enable" in a apache2_*.bb not
> > 
> > > work? It works fine for me with wpa-supplicant:
> > Sorry. You are correct the bbappend will overwrite it, but this
> > requires a bbappend. If this used "?=" you could achieve this in a
> > local.conf or similar. 
> 
> SYSTEMD_AUTO_ENABLE_pn-wpa-supplicant = "enable" in local.conf also
> overrides the = assignment in the .bb file.
> 
> > In general if there is a possibility for a value to be desireable to
> > overwrite using "?=" makes sense. Thoughts?
> 
> I thought the same for a while, but since then I've come around to the
> interpretation that for recipe-specific variables, using =? is mostly
> just a cosmetic thing. I can't think of a good example where it really
> matters in practice.
> 
> It's different for global variables which might get set prior to
> parsing a recipe (distro config, local.conf). There it makes sense to
> not overwrite a potentially existing value.

I guess I am just in the habit of using the assignment operator which makes 
the most sense (even just for readability sake). Sure in this case it can be 
overwritten but like me I suspect others would have to actually attempt this 
to convince themselves it works, whereas the early assignment operator would 
have made it more explicit. Anyway, not worth pursuing any further.

The bigger question for me is why these recipes are disabling their auto start 
out of the gate. If I do 'apt install apache2' on a Ubu box I expect that the 
service will start automatically, and it does, so why do we force folks to 
'work around' this recipe disabling apache2 from auto starting? (I have yet to 
go back to look at the history to see if there is a legit reason)

MarkA









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

end of thread, other threads:[~2017-11-20 23:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 15:19 [meta-webserver][PATCH] meta-webserver: apache2 allow SYSTEMD_AUTO_ENABLE to be overwritten Mark Asselstine
2017-11-16 18:28 ` Patrick Ohly
2017-11-16 20:00   ` Mark Asselstine
2017-11-16 22:14     ` Patrick Ohly
2017-11-20 23:02       ` Mark Asselstine

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.