Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] libdaemons localstatedir /usr/var
@ 2014-10-12  0:55 Jörg Krause
  2014-10-12  7:18 ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Jörg Krause @ 2014-10-12  0:55 UTC (permalink / raw)
  To: buildroot

I have a package which uses libdaemon for running as a daemoon and for 
creating the pid file. libdaemons default directory for opening the pid 
file is /usr/var/run. However, buildroot does not create this directory 
in the output directory by default. The package compiles successfully 
but fails to run because of the missing directory.

How should I deal with this?

1) patch libdaemon.mk: LIBDAEMON_CONF_OPTS = ... --localstatedir=/var
2) add /usr/var/run to my rootfs overlay directory

What do you think? Any other suggestions?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141012/e99f62df/attachment.html>

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-12  0:55 [Buildroot] libdaemons localstatedir /usr/var Jörg Krause
@ 2014-10-12  7:18 ` Thomas Petazzoni
  2014-10-12  9:26   ` Jörg Krause
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2014-10-12  7:18 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

On Sun, 12 Oct 2014 02:55:57 +0200, J?rg Krause wrote:
> I have a package which uses libdaemon for running as a daemoon and for 
> creating the pid file. libdaemons default directory for opening the pid 
> file is /usr/var/run. However, buildroot does not create this directory 
> in the output directory by default. The package compiles successfully 
> but fails to run because of the missing directory.
> 
> How should I deal with this?
> 
> 1) patch libdaemon.mk: LIBDAEMON_CONF_OPTS = ... --localstatedir=/var
> 2) add /usr/var/run to my rootfs overlay directory
> 
> What do you think? Any other suggestions?

I'd say (1).

Isn't --localstatedir a common autoconf variable ? I see 26 packages
passing --localstatedir=/var in Buildroot. Maybe it's time to move as a
common definition, like --prefix=/usr ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-12  7:18 ` Thomas Petazzoni
@ 2014-10-12  9:26   ` Jörg Krause
  2014-10-12 13:09     ` Arnout Vandecappelle
  0 siblings, 1 reply; 9+ messages in thread
From: Jörg Krause @ 2014-10-12  9:26 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

On 10/12/2014 09:18 AM, Thomas Petazzoni wrote:
> Dear J?rg Krause,
>
> On Sun, 12 Oct 2014 02:55:57 +0200, J?rg Krause wrote:
>> I have a package which uses libdaemon for running as a daemoon and for
>> creating the pid file. libdaemons default directory for opening the pid
>> file is /usr/var/run. However, buildroot does not create this directory
>> in the output directory by default. The package compiles successfully
>> but fails to run because of the missing directory.
>>
>> How should I deal with this?
>>
>> 1) patch libdaemon.mk: LIBDAEMON_CONF_OPTS = ... --localstatedir=/var
>> 2) add /usr/var/run to my rootfs overlay directory
>>
>> What do you think? Any other suggestions?
> I'd say (1).

Looks good. I will prepare a patch.

> Isn't --localstatedir a common autoconf variable ? I see 26 packages
> passing --localstatedir=/var in Buildroot. Maybe it's time to move as a
> common definition, like --prefix=/usr ?

Yes, it is. There was a discussion on the mailing list long time ago:

    Making --localstatedir=/var global?
    (http://lists.busybox.net/pipermail/buildroot/2011-April/042918.html.)

And also this one:

    Bizarre things on the allyespackageconfig build
    (http://lists.busybox.net/pipermail/buildroot/2013-May/071856.html)

Best regards
J?rg Krause
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141012/44a6492c/attachment.html>

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-12  9:26   ` Jörg Krause
@ 2014-10-12 13:09     ` Arnout Vandecappelle
  2014-10-12 15:56       ` Jörg Krause
  2014-10-17  0:21       ` Jörg Krause
  0 siblings, 2 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2014-10-12 13:09 UTC (permalink / raw)
  To: buildroot

On 12/10/14 11:26, J?rg Krause wrote:
> Dear Thomas Petazzoni,
> 
> On 10/12/2014 09:18 AM, Thomas Petazzoni wrote:
>> Dear J?rg Krause,
>>
>> On Sun, 12 Oct 2014 02:55:57 +0200, J?rg Krause wrote:
>>> I have a package which uses libdaemon for running as a daemoon and for 
>>> creating the pid file. libdaemons default directory for opening the pid 
>>> file is /usr/var/run. However, buildroot does not create this directory 
>>> in the output directory by default. The package compiles successfully 
>>> but fails to run because of the missing directory.
>>>
>>> How should I deal with this?
>>>
>>> 1) patch libdaemon.mk: LIBDAEMON_CONF_OPTS = ... --localstatedir=/var
>>> 2) add /usr/var/run to my rootfs overlay directory
>>>
>>> What do you think? Any other suggestions?
>> I'd say (1).
> 
> Looks good. I will prepare a patch.
> 
>> Isn't --localstatedir a common autoconf variable ? I see 26 packages
>> passing --localstatedir=/var in Buildroot. Maybe it's time to move as a
>> common definition, like --prefix=/usr ?
> 
> Yes, it is. There was a discussion on the mailing list long time ago:
> 
>     Making --localstatedir=/var global?
>     (http://lists.busybox.net/pipermail/buildroot/2011-April/042918.html.)
> 
> And also this one:
> 
>     Bizarre things on the allyespackageconfig build
>     (http://lists.busybox.net/pipermail/buildroot/2013-May/071856.html)

 +1 to making it a global pkg-autotools option. J?rg, care to prepare a patch
for that? Removing the existing --localstatedir should be a separate patch then.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-12 13:09     ` Arnout Vandecappelle
@ 2014-10-12 15:56       ` Jörg Krause
  2014-10-12 16:13         ` Thomas Petazzoni
  2014-10-17  0:21       ` Jörg Krause
  1 sibling, 1 reply; 9+ messages in thread
From: Jörg Krause @ 2014-10-12 15:56 UTC (permalink / raw)
  To: buildroot


On 10/12/2014 03:09 PM, Arnout Vandecappelle wrote:
> On 12/10/14 11:26, J?rg Krause wrote:
>> Dear Thomas Petazzoni,
>>
>> On 10/12/2014 09:18 AM, Thomas Petazzoni wrote:
>>> Dear J?rg Krause,
>>>
>>> On Sun, 12 Oct 2014 02:55:57 +0200, J?rg Krause wrote:
>>>> I have a package which uses libdaemon for running as a daemoon and for
>>>> creating the pid file. libdaemons default directory for opening the pid
>>>> file is /usr/var/run. However, buildroot does not create this directory
>>>> in the output directory by default. The package compiles successfully
>>>> but fails to run because of the missing directory.
>>>>
>>>> How should I deal with this?
>>>>
>>>> 1) patch libdaemon.mk: LIBDAEMON_CONF_OPTS = ... --localstatedir=/var
>>>> 2) add /usr/var/run to my rootfs overlay directory
>>>>
>>>> What do you think? Any other suggestions?
>>> I'd say (1).
>> Looks good. I will prepare a patch.
>>
>>> Isn't --localstatedir a common autoconf variable ? I see 26 packages
>>> passing --localstatedir=/var in Buildroot. Maybe it's time to move as a
>>> common definition, like --prefix=/usr ?
>> Yes, it is. There was a discussion on the mailing list long time ago:
>>
>>      Making --localstatedir=/var global?
>>      (http://lists.busybox.net/pipermail/buildroot/2011-April/042918.html.)
>>
>> And also this one:
>>
>>      Bizarre things on the allyespackageconfig build
>>      (http://lists.busybox.net/pipermail/buildroot/2013-May/071856.html)
>   +1 to making it a global pkg-autotools option. J?rg, care to prepare a patch
> for that? Removing the existing --localstatedir should be a separate patch then.

I will prepare a patch for this. Should I add this to host configure, 
too? I guess so...

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-12 15:56       ` Jörg Krause
@ 2014-10-12 16:13         ` Thomas Petazzoni
  2014-10-12 16:18           ` Arnout Vandecappelle
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2014-10-12 16:13 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

On Sun, 12 Oct 2014 17:56:02 +0200, J?rg Krause wrote:

> >>      Bizarre things on the allyespackageconfig build
> >>      (http://lists.busybox.net/pipermail/buildroot/2013-May/071856.html)
> >   +1 to making it a global pkg-autotools option. J?rg, care to prepare a patch
> > for that? Removing the existing --localstatedir should be a separate patch then.
> 
> I will prepare a patch for this. Should I add this to host configure, 
> too? I guess so...

If you add that to host configure, it should be $(HOST_DIR)/var.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-12 16:13         ` Thomas Petazzoni
@ 2014-10-12 16:18           ` Arnout Vandecappelle
  0 siblings, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2014-10-12 16:18 UTC (permalink / raw)
  To: buildroot

On 12/10/14 18:13, Thomas Petazzoni wrote:
> Dear J?rg Krause,
>
> On Sun, 12 Oct 2014 17:56:02 +0200, J?rg Krause wrote:
>
> >>>      Bizarre things on the allyespackageconfig build
> >>>      (http://lists.busybox.net/pipermail/buildroot/2013-May/071856.html)
> >>   +1 to making it a global pkg-autotools option. J?rg, care to prepare a patch
> >> for that? Removing the existing --localstatedir should be a separate patch
> then.
> >
> > I will prepare a patch for this. Should I add this to host configure,
> > too? I guess so...
>
> If you add that to host configure, it should be $(HOST_DIR)/var.

 But I don't think that there's any host package that does anything
useful with the localstatedir.

 Regards,
 Arnout

>
> Thomas
>


-- 
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-12 13:09     ` Arnout Vandecappelle
  2014-10-12 15:56       ` Jörg Krause
@ 2014-10-17  0:21       ` Jörg Krause
  2014-10-17  8:53         ` Thomas Petazzoni
  1 sibling, 1 reply; 9+ messages in thread
From: Jörg Krause @ 2014-10-17  0:21 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,
Dear Arnout Vandecappelle,

On 10/12/2014 03:09 PM, Arnout Vandecappelle wrote:
> On 12/10/14 11:26, J?rg Krause wrote:
>>> >>Isn't --localstatedir a common autoconf variable ? I see 26 packages
>>> >>passing --localstatedir=/var in Buildroot. Maybe it's time to move as a
>>> >>common definition, like --prefix=/usr ?
>> >
>> >Yes, it is. There was a discussion on the mailing list long time ago:
>> >
>> >     Making --localstatedir=/var global?
>> >     (http://lists.busybox.net/pipermail/buildroot/2011-April/042918.html.)
>> >
>> >And also this one:
>> >
>> >     Bizarre things on the allyespackageconfig build
>> >     (http://lists.busybox.net/pipermail/buildroot/2013-May/071856.html)
>   +1 to making it a global pkg-autotools option. J?rg, care to prepare a patch
> for that? Removing the existing --localstatedir should be a separate patch then.

I started with setting --localstatedir=/var globally. There are three 
packages which set localstatedir to another directory as /var:

* dhcp: It's save to remove local localstatedir here. Is it used for 
setting leases and pid files. All leases and pid files are set as config 
options in the dhcp.mk.
* proftpd: Uses localstatedir to set the location of the pid file:

    AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`")
    AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo
    "${localstatedir}/proftpd.pid"`")

Maybe a patch should set it to?:

    AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}/run"`")
    AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo
    "${localstatedir}/run/proftpd.pid"`")

* mysql: localstatedir sets the location for database directories and 
other files. Not sure how to handle this.

Do you have any suggestions?

J?rg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20141017/1dcc90c1/attachment.html>

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

* [Buildroot] libdaemons localstatedir /usr/var
  2014-10-17  0:21       ` Jörg Krause
@ 2014-10-17  8:53         ` Thomas Petazzoni
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2014-10-17  8:53 UTC (permalink / raw)
  To: buildroot

Dear J?rg Krause,

On Fri, 17 Oct 2014 02:21:29 +0200, J?rg Krause wrote:

> I started with setting --localstatedir=/var globally. There are three 
> packages which set localstatedir to another directory as /var:
> 
> * dhcp: It's save to remove local localstatedir here. Is it used for 
> setting leases and pid files. All leases and pid files are set as config 
> options in the dhcp.mk.

Ok.

> * proftpd: Uses localstatedir to set the location of the pid file:
> 
>     AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`")
>     AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo
>     "${localstatedir}/proftpd.pid"`")
> 
> Maybe a patch should set it to?:
> 
>     AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}/run"`")
>     AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo
>     "${localstatedir}/run/proftpd.pid"`")

Sounds good.

> * mysql: localstatedir sets the location for database directories and 
> other files. Not sure how to handle this.

You can keep a custom --localstatedir in mysql.mk.

One of the good thing with autoconf is that if you pass:

	--localstatedir=/var ... --localstatedir=/var/something

Then /var/something will be used. So, we can set --localstatedir=/var
by default in the infrastructure, and still have certain packages doing
weird things override it.

So this also means that your patch should be in at least two steps: one
step adding --localstatedir=/var to the infrastructure, and then one
patch removing --localstatedir=/var from the packages where this is no
longer needed.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2014-10-17  8:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-12  0:55 [Buildroot] libdaemons localstatedir /usr/var Jörg Krause
2014-10-12  7:18 ` Thomas Petazzoni
2014-10-12  9:26   ` Jörg Krause
2014-10-12 13:09     ` Arnout Vandecappelle
2014-10-12 15:56       ` Jörg Krause
2014-10-12 16:13         ` Thomas Petazzoni
2014-10-12 16:18           ` Arnout Vandecappelle
2014-10-17  0:21       ` Jörg Krause
2014-10-17  8:53         ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox