All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script
@ 2017-03-08 15:21 Philipp Skadorov
  2017-03-08 17:34 ` Baruch Siach
  2017-03-08 20:11 ` Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Philipp Skadorov @ 2017-03-08 15:21 UTC (permalink / raw)
  To: buildroot

lighttpd server runs cgi application that has no way to get environment
variables that are set up for it.

S50lighttpd is changed to source /etc/default/lighttpd file where these
environment variables can be set up.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
---
 package/lighttpd/S50lighttpd | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/lighttpd/S50lighttpd b/package/lighttpd/S50lighttpd
index 44ac257c1..b3518cd27 100644
--- a/package/lighttpd/S50lighttpd
+++ b/package/lighttpd/S50lighttpd
@@ -2,15 +2,21 @@
 #
 # Starts lighttpd.
 #
+NAME=lighttpd
+DAEMON=/usr/sbin/$NAME
+PID_FILE="/var/run/$NAME.pid"
+CONF_FILE="/etc/$NAME/$NAME.conf"
+
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
 start() {
 	printf "Starting lighttpd: "
-	start-stop-daemon -S -q -p /var/run/lighttpd.pid --exec /usr/sbin/lighttpd -- -f /etc/lighttpd/lighttpd.conf
+	start-stop-daemon -S -q -p $PID_FILE --exec $DAEMON -- -f $CONF_FILE
 	echo "OK"
 }
 stop() {
 	printf "Stopping lighttpd: "
-	start-stop-daemon -K -q -p /var/run/lighttpd.pid
+	start-stop-daemon -K -q -p $PID_FILE
 	echo "OK"
 }
 restart() {
-- 
2.11.0

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

* [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script
  2017-03-08 15:21 [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script Philipp Skadorov
@ 2017-03-08 17:34 ` Baruch Siach
  2017-03-08 18:44   ` Philipp Skadorov
  2017-03-08 20:11 ` Thomas Petazzoni
  1 sibling, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2017-03-08 17:34 UTC (permalink / raw)
  To: buildroot

Hi Philipp,

On Wed, Mar 08, 2017 at 10:21:14AM -0500, Philipp Skadorov wrote:
> lighttpd server runs cgi application that has no way to get environment
> variables that are set up for it.
> 
> S50lighttpd is changed to source /etc/default/lighttpd file where these
> environment variables can be set up.
> 
> Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
> ---
>  package/lighttpd/S50lighttpd | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/package/lighttpd/S50lighttpd b/package/lighttpd/S50lighttpd
> index 44ac257c1..b3518cd27 100644
> --- a/package/lighttpd/S50lighttpd
> +++ b/package/lighttpd/S50lighttpd
> @@ -2,15 +2,21 @@
>  #
>  # Starts lighttpd.
>  #
> +NAME=lighttpd
> +DAEMON=/usr/sbin/$NAME
> +PID_FILE="/var/run/$NAME.pid"
> +CONF_FILE="/etc/$NAME/$NAME.conf"

Should be

  CONF_FILE="/etc/default/$NAME.conf"

to mach the commit log text.

> +
> +[ -r /etc/default/$NAME ] && . /etc/default/$NAME
>  
>  start() {
>  	printf "Starting lighttpd: "
> -	start-stop-daemon -S -q -p /var/run/lighttpd.pid --exec /usr/sbin/lighttpd -- -f /etc/lighttpd/lighttpd.conf
> +	start-stop-daemon -S -q -p $PID_FILE --exec $DAEMON -- -f $CONF_FILE
>  	echo "OK"
>  }
>  stop() {
>  	printf "Stopping lighttpd: "
> -	start-stop-daemon -K -q -p /var/run/lighttpd.pid
> +	start-stop-daemon -K -q -p $PID_FILE
>  	echo "OK"
>  }
>  restart() {

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script
  2017-03-08 17:34 ` Baruch Siach
@ 2017-03-08 18:44   ` Philipp Skadorov
  2017-03-08 18:57     ` Baruch Siach
  0 siblings, 1 reply; 8+ messages in thread
From: Philipp Skadorov @ 2017-03-08 18:44 UTC (permalink / raw)
  To: buildroot

Hi Baruch,

----- Original Message -----
> From: "Baruch Siach" <baruch@tkos.co.il>
> To: "Philipp Skadorov" <philipp.skadorov@savoirfairelinux.com>
> Cc: buildroot at buildroot.org
> Sent: Wednesday, March 8, 2017 12:34:20 PM
> Subject: Re: [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script

> Hi Philipp,
> 
> On Wed, Mar 08, 2017 at 10:21:14AM -0500, Philipp Skadorov wrote:
>> lighttpd server runs cgi application that has no way to get environment
>> variables that are set up for it.
>> 
>> S50lighttpd is changed to source /etc/default/lighttpd file where these
>> environment variables can be set up.
>> 
>> Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
>> ---
>>  package/lighttpd/S50lighttpd | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>> 
>> diff --git a/package/lighttpd/S50lighttpd b/package/lighttpd/S50lighttpd
>> index 44ac257c1..b3518cd27 100644
>> --- a/package/lighttpd/S50lighttpd
>> +++ b/package/lighttpd/S50lighttpd
>> @@ -2,15 +2,21 @@
>>  #
>>  # Starts lighttpd.
>>  #
>> +NAME=lighttpd
>> +DAEMON=/usr/sbin/$NAME
>> +PID_FILE="/var/run/$NAME.pid"
>> +CONF_FILE="/etc/$NAME/$NAME.conf"
> 
> Should be
> 
>  CONF_FILE="/etc/default/$NAME.conf"
> 
> to mach the commit log text.
> 

You are referring to the package original config file, /etc/lighttpd/lighttpd.conf.
It has gone nowhere from /etc/lighttpd dir.

Before the daemon is run with it, the new file /etc/default/lighttpd
is sourced (if present) to set up the custom environment.


Regards,
Philipp


>> +
>> +[ -r /etc/default/$NAME ] && . /etc/default/$NAME
>>  
>>  start() {
>>  	printf "Starting lighttpd: "
>> -	start-stop-daemon -S -q -p /var/run/lighttpd.pid --exec /usr/sbin/lighttpd --
>> -f /etc/lighttpd/lighttpd.conf
>> +	start-stop-daemon -S -q -p $PID_FILE --exec $DAEMON -- -f $CONF_FILE
>>  	echo "OK"
>>  }
>>  stop() {
>>  	printf "Stopping lighttpd: "
>> -	start-stop-daemon -K -q -p /var/run/lighttpd.pid
>> +	start-stop-daemon -K -q -p $PID_FILE
>>  	echo "OK"
>>  }
>>  restart() {
> 
> baruch
> 
> --
>     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script
  2017-03-08 18:44   ` Philipp Skadorov
@ 2017-03-08 18:57     ` Baruch Siach
  0 siblings, 0 replies; 8+ messages in thread
From: Baruch Siach @ 2017-03-08 18:57 UTC (permalink / raw)
  To: buildroot

Hi Philipp,

On Wed, Mar 08, 2017 at 01:44:12PM -0500, Philipp Skadorov wrote:
> ----- Original Message -----
> > On Wed, Mar 08, 2017 at 10:21:14AM -0500, Philipp Skadorov wrote:
> >> +NAME=lighttpd
> >> +DAEMON=/usr/sbin/$NAME
> >> +PID_FILE="/var/run/$NAME.pid"
> >> +CONF_FILE="/etc/$NAME/$NAME.conf"
> > 
> > Should be
> > 
> >  CONF_FILE="/etc/default/$NAME.conf"
> > 
> > to mach the commit log text.
> 
> You are referring to the package original config file, /etc/lighttpd/lighttpd.conf.
> It has gone nowhere from /etc/lighttpd dir.
> 
> Before the daemon is run with it, the new file /etc/default/lighttpd
> is sourced (if present) to set up the custom environment.

You are right, of course. I mixed it up. Sorry for the noise.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script
  2017-03-08 15:21 [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script Philipp Skadorov
  2017-03-08 17:34 ` Baruch Siach
@ 2017-03-08 20:11 ` Thomas Petazzoni
  2017-03-08 20:43   ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Philipp Skadorov
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2017-03-08 20:11 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  8 Mar 2017 10:21:14 -0500, Philipp Skadorov wrote:
> lighttpd server runs cgi application that has no way to get environment
> variables that are set up for it.
> 
> S50lighttpd is changed to source /etc/default/lighttpd file where these
> environment variables can be set up.
> 
> Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>

There is a mismatch between the commit log (which only talks about
sourcing a default file) and the actual commit which not only sources a
default file, but also refactors other aspects of the init script to
use variables.

So this should probably be two separate commits, or at the very least
be mentioned in the commit log.

Thanks!

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

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

* [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables
  2017-03-08 20:11 ` Thomas Petazzoni
@ 2017-03-08 20:43   ` Philipp Skadorov
  2017-03-08 20:43     ` [Buildroot] [PATCH v2 2/2] lighttpd: source default file from startup script Philipp Skadorov
  2017-03-09 20:53     ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Thomas Petazzoni
  0 siblings, 2 replies; 8+ messages in thread
From: Philipp Skadorov @ 2017-03-08 20:43 UTC (permalink / raw)
  To: buildroot

S50lighttpd contains repeating keywords that are worth carrying out as
variables: pid file name, daemon name, config file name.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
---
 package/lighttpd/S50lighttpd | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/package/lighttpd/S50lighttpd b/package/lighttpd/S50lighttpd
index 44ac257c1..7a14ec8a9 100644
--- a/package/lighttpd/S50lighttpd
+++ b/package/lighttpd/S50lighttpd
@@ -2,15 +2,19 @@
 #
 # Starts lighttpd.
 #
+NAME=lighttpd
+DAEMON=/usr/sbin/$NAME
+PID_FILE="/var/run/$NAME.pid"
+CONF_FILE="/etc/$NAME/$NAME.conf"
 
 start() {
 	printf "Starting lighttpd: "
-	start-stop-daemon -S -q -p /var/run/lighttpd.pid --exec /usr/sbin/lighttpd -- -f /etc/lighttpd/lighttpd.conf
+	start-stop-daemon -S -q -p $PID_FILE --exec $DAEMON -- -f $CONF_FILE
 	echo "OK"
 }
 stop() {
 	printf "Stopping lighttpd: "
-	start-stop-daemon -K -q -p /var/run/lighttpd.pid
+	start-stop-daemon -K -q -p $PID_FILE
 	echo "OK"
 }
 restart() {
-- 
2.11.0

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

* [Buildroot] [PATCH v2 2/2] lighttpd: source default file from startup script
  2017-03-08 20:43   ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Philipp Skadorov
@ 2017-03-08 20:43     ` Philipp Skadorov
  2017-03-09 20:53     ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Philipp Skadorov @ 2017-03-08 20:43 UTC (permalink / raw)
  To: buildroot

lighttpd server runs cgi application that has no way to get environment
variables that are set up for it.

S50lighttpd is changed to source /etc/default/lighttpd file where these
environment variables can be set up.

Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
---
 package/lighttpd/S50lighttpd | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/lighttpd/S50lighttpd b/package/lighttpd/S50lighttpd
index 7a14ec8a9..b3518cd27 100644
--- a/package/lighttpd/S50lighttpd
+++ b/package/lighttpd/S50lighttpd
@@ -7,6 +7,8 @@ DAEMON=/usr/sbin/$NAME
 PID_FILE="/var/run/$NAME.pid"
 CONF_FILE="/etc/$NAME/$NAME.conf"
 
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
 start() {
 	printf "Starting lighttpd: "
 	start-stop-daemon -S -q -p $PID_FILE --exec $DAEMON -- -f $CONF_FILE
-- 
2.11.0

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

* [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables
  2017-03-08 20:43   ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Philipp Skadorov
  2017-03-08 20:43     ` [Buildroot] [PATCH v2 2/2] lighttpd: source default file from startup script Philipp Skadorov
@ 2017-03-09 20:53     ` Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2017-03-09 20:53 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  8 Mar 2017 15:43:31 -0500, Philipp Skadorov wrote:
> S50lighttpd contains repeating keywords that are worth carrying out as
> variables: pid file name, daemon name, config file name.
> 
> Signed-off-by: Philipp Skadorov <philipp.skadorov@savoirfairelinux.com>
> ---
>  package/lighttpd/S50lighttpd | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Both patches applied. Thanks!

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

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08 15:21 [Buildroot] [PATCH 1/1] lighttpd: source default file from startup script Philipp Skadorov
2017-03-08 17:34 ` Baruch Siach
2017-03-08 18:44   ` Philipp Skadorov
2017-03-08 18:57     ` Baruch Siach
2017-03-08 20:11 ` Thomas Petazzoni
2017-03-08 20:43   ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Philipp Skadorov
2017-03-08 20:43     ` [Buildroot] [PATCH v2 2/2] lighttpd: source default file from startup script Philipp Skadorov
2017-03-09 20:53     ` [Buildroot] [PATCH v2 1/2] lighttpd: carry common keywords out to variables Thomas Petazzoni

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.