All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add init script (sysv) support for busybox's ntpd
@ 2014-03-20  3:26 Laszlo Papp
  2014-03-20 10:45 ` Burton, Ross
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20  3:26 UTC (permalink / raw)
  To: openembedded-core

---
 meta/recipes-core/busybox/busybox.inc             | 10 ++++--
 meta/recipes-core/busybox/busybox_1.22.1.bb       |  2 ++
 meta/recipes-core/busybox/files/busybox-ntpd      | 39 +++++++++++++++++++++++
 meta/recipes-core/busybox/files/busybox-ntpd.conf |  1 +
 4 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-core/busybox/files/busybox-ntpd
 create mode 100644 meta/recipes-core/busybox/files/busybox-ntpd.conf

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 69b9b0c..653ab16 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -18,7 +18,7 @@ BUSYBOX_SPLIT_SUID ?= "1"
 export EXTRA_CFLAGS = "${CFLAGS}"
 export EXTRA_LDFLAGS = "${LDFLAGS}"
 
-PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
+PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock ${PN}-ntpd"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
 FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
@@ -26,8 +26,9 @@ FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
 FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
+FILES_${PN}-ntpd = "${sysconfdir}/init.d/busybox-ntpd ${sysconfdir}/busybox-ntpd.conf"
 
-INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock ${PN}-ntpd"
 
 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
 INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
@@ -35,6 +36,7 @@ INITSCRIPT_NAME_${PN}-mdev = "mdev"
 INITSCRIPT_PARAMS_${PN}-mdev = "start 03 S ."
 INITSCRIPT_NAME_${PN}-syslog = "syslog"
 INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 
+INITSCRIPT_NAME_${PN}-ntpd = "busybox-ntpd"
 
 SYSTEMD_PACKAGES = "${PN}-syslog"
 SYSTEMD_SERVICE_${PN}-syslog = "busybox-syslog.service"
@@ -264,6 +266,10 @@ do_install () {
                        install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
                fi
 	fi
+    if grep "CONFIG_NTPD=y" ${B}/.config; then
+		install -m 0755 ${WORKDIR}/busybox-ntpd ${D}${sysconfdir}/init.d/
+		install -m 0644 ${WORKDIR}/busybox-ntpd.conf ${D}${sysconfdir}/
+	fi
 
     if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
         install -d ${D}${systemd_unitdir}/system
diff --git a/meta/recipes-core/busybox/busybox_1.22.1.bb b/meta/recipes-core/busybox/busybox_1.22.1.bb
index ffc9435..c513aa2 100644
--- a/meta/recipes-core/busybox/busybox_1.22.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.22.1.bb
@@ -27,6 +27,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://inetd.conf \
            file://inetd \
            file://login-utilities.cfg \
+           file://busybox-ntpd \
+           file://busybox-ntpd.conf \
 "
 
 SRC_URI[tarball.md5sum] = "337d1a15ab1cb1d4ed423168b1eb7d7e"
diff --git a/meta/recipes-core/busybox/files/busybox-ntpd b/meta/recipes-core/busybox/files/busybox-ntpd
new file mode 100644
index 0000000..e558973
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-ntpd
@@ -0,0 +1,39 @@
+#!/bin/sh
+DAEMON=/sbin/ntpd
+NAME=ntpd
+DESC="Busybox NTP Daemon"
+source /etc/busybox-ntpd.conf
+ARGS="-p $PEER"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+    start)
+        start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+        echo "done."
+        ;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+        start-stop-daemon -K -n $NAME
+        echo "done."
+        ;;
+    restart)
+        echo "restarting $DESC: $NAME... "
+        $0 stop
+        $0 start
+        echo "done."
+        ;;
+    reload)
+        echo -n "reloading $DESC: $NAME... "
+        killall -HUP $(basename ${DAEMON})
+        echo "done."
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart|reload}"
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-ntpd.conf b/meta/recipes-core/busybox/files/busybox-ntpd.conf
new file mode 100644
index 0000000..65665d8
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-ntpd.conf
@@ -0,0 +1 @@
+PEER=127.0.0.1
-- 
1.9.0



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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20  3:26 [PATCH] Add init script (sysv) support for busybox's ntpd Laszlo Papp
@ 2014-03-20 10:45 ` Burton, Ross
  2014-03-20 11:22   ` Koen Kooi
  2014-03-20 11:34   ` Laszlo Papp
  0 siblings, 2 replies; 27+ messages in thread
From: Burton, Ross @ 2014-03-20 10:45 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: OE-core

On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
> +PEER=127.0.0.1

That doesn't seem like a very useful default.  We also can't use the
NTP pool by default, so this should copy the behaviour of the ntpd
package in meta-networking and default to no peers, and not start if
none are specified.

Ross


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 10:45 ` Burton, Ross
@ 2014-03-20 11:22   ` Koen Kooi
  2014-03-20 11:34     ` Laszlo Papp
  2014-03-20 11:34   ` Laszlo Papp
  1 sibling, 1 reply; 27+ messages in thread
From: Koen Kooi @ 2014-03-20 11:22 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core


Op 20 mrt. 2014, om 11:45 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:

> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
>> +PEER=127.0.0.1
> 
> That doesn't seem like a very useful default.  We also can't use the
> NTP pool by default, so this should copy the behaviour of the ntpd
> package in meta-networking and default to no peers, and not start if
> none are specified.

And the initscript is missing LSB headers.

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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 10:45 ` Burton, Ross
  2014-03-20 11:22   ` Koen Kooi
@ 2014-03-20 11:34   ` Laszlo Papp
  1 sibling, 0 replies; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20 11:34 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Thu, Mar 20, 2014 at 10:45 AM, Burton, Ross <ross.burton@intel.com> wrote:
> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
>> +PEER=127.0.0.1
>
> That doesn't seem like a very useful default.  We also can't use the
> NTP pool by default, so this should copy the behaviour of the ntpd
> package in meta-networking and default to no peers, and not start if
> none are specified.

Yeah, some real timeserver could be put behind comments.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 11:22   ` Koen Kooi
@ 2014-03-20 11:34     ` Laszlo Papp
  2014-03-20 11:59       ` Otavio Salvador
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20 11:34 UTC (permalink / raw)
  To: Koen Kooi; +Cc: OE-core

On Thu, Mar 20, 2014 at 11:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>
> Op 20 mrt. 2014, om 11:45 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:
>
>> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
>>> +PEER=127.0.0.1
>>
>> That doesn't seem like a very useful default.  We also can't use the
>> NTP pool by default, so this should copy the behaviour of the ntpd
>> package in meta-networking and default to no peers, and not start if
>> none are specified.
>
> And the initscript is missing LSB headers.

Just like the other similar scripts.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 11:34     ` Laszlo Papp
@ 2014-03-20 11:59       ` Otavio Salvador
  2014-03-20 12:16         ` Laszlo Papp
  0 siblings, 1 reply; 27+ messages in thread
From: Otavio Salvador @ 2014-03-20 11:59 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, OE-core

On Thu, Mar 20, 2014 at 8:34 AM, Laszlo Papp <lpapp@kde.org> wrote:
> On Thu, Mar 20, 2014 at 11:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>
>> Op 20 mrt. 2014, om 11:45 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:
>>
>>> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
>>>> +PEER=127.0.0.1
>>>
>>> That doesn't seem like a very useful default.  We also can't use the
>>> NTP pool by default, so this should copy the behaviour of the ntpd
>>> package in meta-networking and default to no peers, and not start if
>>> none are specified.
>>
>> And the initscript is missing LSB headers.
>
> Just like the other similar scripts.

This does not mean we ought to make the problem worse so add it for
new ones. If you are in good mood, send a fix for the others too ;)

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 11:59       ` Otavio Salvador
@ 2014-03-20 12:16         ` Laszlo Papp
  2014-03-20 12:26           ` Otavio Salvador
  2014-03-20 16:42           ` Khem Raj
  0 siblings, 2 replies; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20 12:16 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: Koen Kooi, OE-core

On Thu, Mar 20, 2014 at 11:59 AM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Thu, Mar 20, 2014 at 8:34 AM, Laszlo Papp <lpapp@kde.org> wrote:
>> On Thu, Mar 20, 2014 at 11:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>
>>> Op 20 mrt. 2014, om 11:45 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:
>>>
>>>> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
>>>>> +PEER=127.0.0.1
>>>>
>>>> That doesn't seem like a very useful default.  We also can't use the
>>>> NTP pool by default, so this should copy the behaviour of the ntpd
>>>> package in meta-networking and default to no peers, and not start if
>>>> none are specified.
>>>
>>> And the initscript is missing LSB headers.
>>
>> Just like the other similar scripts.
>
> This does not mean we ought to make the problem worse so add it for
> new ones. If you are in good mood, send a fix for the others too ;)

I do not think this is a problem. Could you please point out what
functionality it breaks? Send patches for the others, and I will make
this cosmetic change for this one, too. Consistency is more important
than a mess of different styles, especially when it comes to cosmetic
changes like this.

That said, Ross had a good point - although that is not critical
either, and since everyone is overriding the default, it could work
without that - , so I will update that one.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 12:16         ` Laszlo Papp
@ 2014-03-20 12:26           ` Otavio Salvador
  2014-03-20 12:44             ` Laszlo Papp
  2014-03-20 16:42           ` Khem Raj
  1 sibling, 1 reply; 27+ messages in thread
From: Otavio Salvador @ 2014-03-20 12:26 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, OE-core

On Thu, Mar 20, 2014 at 9:16 AM, Laszlo Papp <lpapp@kde.org> wrote:
> On Thu, Mar 20, 2014 at 11:59 AM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
>> On Thu, Mar 20, 2014 at 8:34 AM, Laszlo Papp <lpapp@kde.org> wrote:
>>> On Thu, Mar 20, 2014 at 11:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>>
>>>> Op 20 mrt. 2014, om 11:45 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:
>>>>
>>>>> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
>>>>>> +PEER=127.0.0.1
>>>>>
>>>>> That doesn't seem like a very useful default.  We also can't use the
>>>>> NTP pool by default, so this should copy the behaviour of the ntpd
>>>>> package in meta-networking and default to no peers, and not start if
>>>>> none are specified.
>>>>
>>>> And the initscript is missing LSB headers.
>>>
>>> Just like the other similar scripts.
>>
>> This does not mean we ought to make the problem worse so add it for
>> new ones. If you are in good mood, send a fix for the others too ;)
>
> I do not think this is a problem. Could you please point out what
> functionality it breaks? Send patches for the others, and I will make
> this cosmetic change for this one, too. Consistency is more important
> than a mess of different styles, especially when it comes to cosmetic
> changes like this.

Koen and I think it is important. So consider this my NACK for the patch as is.

You are free to do whatever you want.

> That said, Ross had a good point - although that is not critical
> either, and since everyone is overriding the default, it could work
> without that - , so I will update that one.

Better.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 12:26           ` Otavio Salvador
@ 2014-03-20 12:44             ` Laszlo Papp
  2014-03-20 13:28               ` Burton, Ross
  2014-03-20 13:30               ` Martin Jansa
  0 siblings, 2 replies; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20 12:44 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: Koen Kooi, OE-core

On Thu, Mar 20, 2014 at 12:26 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Thu, Mar 20, 2014 at 9:16 AM, Laszlo Papp <lpapp@kde.org> wrote:
>> On Thu, Mar 20, 2014 at 11:59 AM, Otavio Salvador
>> <otavio@ossystems.com.br> wrote:
>>> On Thu, Mar 20, 2014 at 8:34 AM, Laszlo Papp <lpapp@kde.org> wrote:
>>>> On Thu, Mar 20, 2014 at 11:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>>>
>>>>> Op 20 mrt. 2014, om 11:45 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:
>>>>>
>>>>>> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
>>>>>>> +PEER=127.0.0.1
>>>>>>
>>>>>> That doesn't seem like a very useful default.  We also can't use the
>>>>>> NTP pool by default, so this should copy the behaviour of the ntpd
>>>>>> package in meta-networking and default to no peers, and not start if
>>>>>> none are specified.
>>>>>
>>>>> And the initscript is missing LSB headers.
>>>>
>>>> Just like the other similar scripts.
>>>
>>> This does not mean we ought to make the problem worse so add it for
>>> new ones. If you are in good mood, send a fix for the others too ;)
>>
>> I do not think this is a problem. Could you please point out what
>> functionality it breaks? Send patches for the others, and I will make
>> this cosmetic change for this one, too. Consistency is more important
>> than a mess of different styles, especially when it comes to cosmetic
>> changes like this.
>
> Koen and I think it is important. So consider this my NACK for the patch as is.

You are free to NACK without an explanation why it is important, but
do not expect it to weigh much that way, at least in my eyes, based on
that you are not even a maintainer as far as I know.

I also think that it is not constructive to give NACK without
answering the questions, and only telling again "It is important".
Please be more constructive and explain the real issue. That is a
better way of convincing a contributor than telling the person it is
bad what you are doing because it is bad.

There was someone today publishing a blog post how important it is to
become pragmatic to get things done. Currently, cosmetic changes are
just in the way of getting things done. The feature shall be more
important than cosmetic changes. I saw this frightening away
contributors, and features actually not getting into projects.

That being said, if you can explain your reasoning, and I find it
reasonable and worthy, I will update it.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 12:44             ` Laszlo Papp
@ 2014-03-20 13:28               ` Burton, Ross
  2014-03-20 16:28                 ` Koen Kooi
  2014-03-20 18:49                 ` Laszlo Papp
  2014-03-20 13:30               ` Martin Jansa
  1 sibling, 2 replies; 27+ messages in thread
From: Burton, Ross @ 2014-03-20 13:28 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, Otavio Salvador, OE-core

On 20 March 2014 12:44, Laszlo Papp <lpapp@kde.org> wrote:
> You are free to NACK without an explanation why it is important, but
> do not expect it to weigh much that way, at least in my eyes, based on
> that you are not even a maintainer as far as I know.

One good reason: systemd reads the LSB headers.

Ross


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 12:44             ` Laszlo Papp
  2014-03-20 13:28               ` Burton, Ross
@ 2014-03-20 13:30               ` Martin Jansa
  1 sibling, 0 replies; 27+ messages in thread
From: Martin Jansa @ 2014-03-20 13:30 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, Otavio Salvador, OE-core

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

On Thu, Mar 20, 2014 at 12:44:47PM +0000, Laszlo Papp wrote:
> On Thu, Mar 20, 2014 at 12:26 PM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
> > On Thu, Mar 20, 2014 at 9:16 AM, Laszlo Papp <lpapp@kde.org> wrote:
> >> On Thu, Mar 20, 2014 at 11:59 AM, Otavio Salvador
> >> <otavio@ossystems.com.br> wrote:
> >>> On Thu, Mar 20, 2014 at 8:34 AM, Laszlo Papp <lpapp@kde.org> wrote:
> >>>> On Thu, Mar 20, 2014 at 11:22 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> >>>>>
> >>>>> Op 20 mrt. 2014, om 11:45 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:
> >>>>>
> >>>>>> On 20 March 2014 03:26, Laszlo Papp <lpapp@kde.org> wrote:
> >>>>>>> +PEER=127.0.0.1
> >>>>>>
> >>>>>> That doesn't seem like a very useful default.  We also can't use the
> >>>>>> NTP pool by default, so this should copy the behaviour of the ntpd
> >>>>>> package in meta-networking and default to no peers, and not start if
> >>>>>> none are specified.
> >>>>>
> >>>>> And the initscript is missing LSB headers.
> >>>>
> >>>> Just like the other similar scripts.
> >>>
> >>> This does not mean we ought to make the problem worse so add it for
> >>> new ones. If you are in good mood, send a fix for the others too ;)
> >>
> >> I do not think this is a problem. Could you please point out what
> >> functionality it breaks? Send patches for the others, and I will make
> >> this cosmetic change for this one, too. Consistency is more important
> >> than a mess of different styles, especially when it comes to cosmetic
> >> changes like this.
> >
> > Koen and I think it is important. So consider this my NACK for the patch as is.
> 
> You are free to NACK without an explanation why it is important, but
> do not expect it to weigh much that way, at least in my eyes, based on
> that you are not even a maintainer as far as I know.
> 
> I also think that it is not constructive to give NACK without
> answering the questions, and only telling again "It is important".
> Please be more constructive and explain the real issue. That is a
> better way of convincing a contributor than telling the person it is
> bad what you are doing because it is bad.
> 
> There was someone today publishing a blog post how important it is to
> become pragmatic to get things done. Currently, cosmetic changes are
> just in the way of getting things done. The feature shall be more
> important than cosmetic changes. I saw this frightening away
> contributors, and features actually not getting into projects.
> 
> That being said, if you can explain your reasoning, and I find it
> reasonable and worthy, I will update it.

I don't remember the exact issue I was seeing in runtime with systemd
and SysV scripts which were missing LSB headers, but it was handling
them somehow different.

If you search meta-oe git log, then you'll find many commit messages
where LSB headers were added when e.g. importing some older recipe from
oe-classic, that's good enough reason to add them to new ntp script,
isn't it?

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 13:28               ` Burton, Ross
@ 2014-03-20 16:28                 ` Koen Kooi
  2014-03-20 19:01                   ` Laszlo Papp
  2014-03-20 18:49                 ` Laszlo Papp
  1 sibling, 1 reply; 27+ messages in thread
From: Koen Kooi @ 2014-03-20 16:28 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Otavio Salvador, OE-core


Op 20 mrt. 2014, om 14:28 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:

> On 20 March 2014 12:44, Laszlo Papp <lpapp@kde.org> wrote:
>> You are free to NACK without an explanation why it is important, but
>> do not expect it to weigh much that way, at least in my eyes, based on
>> that you are not even a maintainer as far as I know.
> 
> One good reason: systemd reads the LSB headers.

As well as other inits that support sysv mode.

regards,

Koen

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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 12:16         ` Laszlo Papp
  2014-03-20 12:26           ` Otavio Salvador
@ 2014-03-20 16:42           ` Khem Raj
  1 sibling, 0 replies; 27+ messages in thread
From: Khem Raj @ 2014-03-20 16:42 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, Otavio Salvador, OE-core

On Thu, Mar 20, 2014 at 5:16 AM, Laszlo Papp <lpapp@kde.org> wrote:
>>>> And the initscript is missing LSB headers.
>>>
>>> Just like the other similar scripts.
>>
>> This does not mean we ought to make the problem worse so add it for
>> new ones. If you are in good mood, send a fix for the others too ;)
>
> I do not think this is a problem. Could you please point out what
> functionality it breaks?

it would be not groked by systemd e.g. folks use sysvinit, systemd,
upstart with OE
moreover we do have aspirations to come closer to lsb
there are lsb images that some distros produce. There might be
existing scripts which
dont have lsb headers however those are wrong examples to adhere to
when generating brand
new scripts.

 Send patches for the others, and I will make
> this cosmetic change for this one, too.

having said above why is that a condition for you to make your patch better ?

Consistency is more important
> than a mess of different styles, especially when it comes to cosmetic
> changes like this.

lets say we are moving towards consistency one after another its not
going to happen overnight
but each contribution in right direction helps.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 13:28               ` Burton, Ross
  2014-03-20 16:28                 ` Koen Kooi
@ 2014-03-20 18:49                 ` Laszlo Papp
  2014-03-20 18:53                   ` Otavio Salvador
  2014-03-20 18:53                   ` Laszlo Papp
  1 sibling, 2 replies; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20 18:49 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Koen Kooi, Otavio Salvador, OE-core

On Thu, Mar 20, 2014 at 1:28 PM, Burton, Ross <ross.burton@intel.com> wrote:
> On 20 March 2014 12:44, Laszlo Papp <lpapp@kde.org> wrote:
>> You are free to NACK without an explanation why it is important, but
>> do not expect it to weigh much that way, at least in my eyes, based on
>> that you are not even a maintainer as far as I know.
>
> One good reason: systemd reads the LSB headers.

This init script is for SysV, not systemd.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 18:49                 ` Laszlo Papp
@ 2014-03-20 18:53                   ` Otavio Salvador
  2014-03-20 18:53                   ` Laszlo Papp
  1 sibling, 0 replies; 27+ messages in thread
From: Otavio Salvador @ 2014-03-20 18:53 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, OE-core

On Thu, Mar 20, 2014 at 3:49 PM, Laszlo Papp <lpapp@kde.org> wrote:
> On Thu, Mar 20, 2014 at 1:28 PM, Burton, Ross <ross.burton@intel.com> wrote:
>> On 20 March 2014 12:44, Laszlo Papp <lpapp@kde.org> wrote:
>>> You are free to NACK without an explanation why it is important, but
>>> do not expect it to weigh much that way, at least in my eyes, based on
>>> that you are not even a maintainer as far as I know.
>>
>> One good reason: systemd reads the LSB headers.
>
> This init script is for SysV, not systemd.

Laszlo, we made several valid points. The outcome is we don't want to
have more init scripts lacking LSB headers. The desire to have this
patch is yours so if you want to have our ack, address those remarks.

As I said, it is your call to handle it or not.

I am not the maintainer of OE-Core, so I don't have a final word on
this (Richard does) but I made clear my point and my NACK for current
status of the patch.


-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 18:49                 ` Laszlo Papp
  2014-03-20 18:53                   ` Otavio Salvador
@ 2014-03-20 18:53                   ` Laszlo Papp
  1 sibling, 0 replies; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20 18:53 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Koen Kooi, Otavio Salvador, OE-core

What is actually probably a bigger issue than the LSB, is that the
conf is currently sourced. That means if it contains an "rm -rf /"
statement, it will execute it.

Perhaps, this should be solved more gently...


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 16:28                 ` Koen Kooi
@ 2014-03-20 19:01                   ` Laszlo Papp
  2014-03-20 19:59                     ` Burton, Ross
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2014-03-20 19:01 UTC (permalink / raw)
  To: Koen Kooi; +Cc: Otavio Salvador, OE-core

On Thu, Mar 20, 2014 at 4:28 PM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>
> Op 20 mrt. 2014, om 14:28 heeft Burton, Ross <ross.burton@intel.com> het volgende geschreven:
>
>> On 20 March 2014 12:44, Laszlo Papp <lpapp@kde.org> wrote:
>>> You are free to NACK without an explanation why it is important, but
>>> do not expect it to weigh much that way, at least in my eyes, based on
>>> that you are not even a maintainer as far as I know.
>>
>> One good reason: systemd reads the LSB headers.
>
> As well as other inits that support sysv mode.

This init script is adding support for sysv and no more. This is also
indicated in the first line of the commit message. I am sorry, but I
will not test it systemd and with other systems. You are free to test
it with everything in the world out there, and provide a more
intelligent change and void my work.

This is what I call not pragmatic. It is not like incremental
improvement is not useful because it does not do all the things in the
world right away. This is clearly communicated in the commit message
what it is for. For SysV, this is not any problem, it works fine.

No one has revealed a real issue with that so far as far as I can
tell. So why block a feature that was meant for something just because
someone cannot test on everything and/or does not want? What is being
read here in my understand is, "everything or nothing". This is not
pragmatic.

Please notice that perfection is the enemy of good. So my bottom line,
feel free to reject this feature in favor of having nothing instead of
something.

Unless someone can come up with a rebuttal that it is not working for
the intended and documentation use case, I am not willing to change
it, sorry. It would be pointless because I could not test it anyway,
and I will not send blind changes like that.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 19:01                   ` Laszlo Papp
@ 2014-03-20 19:59                     ` Burton, Ross
  2014-03-21 13:59                       ` Laszlo Papp
  0 siblings, 1 reply; 27+ messages in thread
From: Burton, Ross @ 2014-03-20 19:59 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, Otavio Salvador, OE-core

On 20 March 2014 19:01, Laszlo Papp <lpapp@kde.org> wrote:
> This init script is adding support for sysv and no more. This is also
> indicated in the first line of the commit message. I am sorry, but I
> will not test it systemd and with other systems

You're not being asked to test with systemd.  You're being asked to
add LSB-standard sysvinit-specific headers to a sysvinit script.

Ross


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-20 19:59                     ` Burton, Ross
@ 2014-03-21 13:59                       ` Laszlo Papp
  2014-03-21 14:39                         ` Martin Jansa
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2014-03-21 13:59 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Koen Kooi, Otavio Salvador, OE-core

On Thu, Mar 20, 2014 at 7:59 PM, Burton, Ross <ross.burton@intel.com> wrote:
> On 20 March 2014 19:01, Laszlo Papp <lpapp@kde.org> wrote:
>> This init script is adding support for sysv and no more. This is also
>> indicated in the first line of the commit message. I am sorry, but I
>> will not test it systemd and with other systems
>
> You're not being asked to test with systemd.  You're being asked to
> add LSB-standard sysvinit-specific headers to a sysvinit script.

In my understanding, people were referring to two issues:

1) not working with systemd and what not compat modes. This is not
something I will test any soon.

2) It is not consistent, whereas if I take a look into busybox, the
consistency is what I do, apparently.

I would like to quote from the Fedora wiki for instance:

"LSB Headers are not required for Fedora SysV-style initscripts, but
they may be used. There is no requirement in the LSB certification for
any system scripts to be LSB compliant, and it can cause issues with
ordering."

So what is wrong about it without systemd and other compat modes? If
it is that big a deal (i.e. blocker), perhaps it is better to document
it in the contribution guideline as a generic trap.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-21 13:59                       ` Laszlo Papp
@ 2014-03-21 14:39                         ` Martin Jansa
  2014-03-22 14:03                           ` Laszlo Papp
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Jansa @ 2014-03-21 14:39 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, Otavio Salvador, OE-core

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

On Fri, Mar 21, 2014 at 01:59:15PM +0000, Laszlo Papp wrote:
> On Thu, Mar 20, 2014 at 7:59 PM, Burton, Ross <ross.burton@intel.com> wrote:
> > On 20 March 2014 19:01, Laszlo Papp <lpapp@kde.org> wrote:
> >> This init script is adding support for sysv and no more. This is also
> >> indicated in the first line of the commit message. I am sorry, but I
> >> will not test it systemd and with other systems
> >
> > You're not being asked to test with systemd.  You're being asked to
> > add LSB-standard sysvinit-specific headers to a sysvinit script.
> 
> In my understanding, people were referring to two issues:
> 
> 1) not working with systemd and what not compat modes. This is not
> something I will test any soon.

Other people already know it's causing the issues without LSB headers,
so if you just add them, you don't need to test it with systemd, other
people who care about systemd will do that for you or at least be OK
with adding this script, because it will have LSB headers (so it should
work fine in systemd world).

> 2) It is not consistent, whereas if I take a look into busybox, the
> consistency is what I do, apparently.
> 
> I would like to quote from the Fedora wiki for instance:
> 
> "LSB Headers are not required for Fedora SysV-style initscripts, but
> they may be used. There is no requirement in the LSB certification for
> any system scripts to be LSB compliant, and it can cause issues with
> ordering."
> 
> So what is wrong about it without systemd and other compat modes? If
> it is that big a deal (i.e. blocker), perhaps it is better to document
> it in the contribution guideline as a generic trap.
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-21 14:39                         ` Martin Jansa
@ 2014-03-22 14:03                           ` Laszlo Papp
  2014-07-25 13:32                             ` Laszlo Papp
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2014-03-22 14:03 UTC (permalink / raw)
  To: Martin Jansa; +Cc: Koen Kooi, Otavio Salvador, OE-core

On Fri, Mar 21, 2014 at 2:39 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Fri, Mar 21, 2014 at 01:59:15PM +0000, Laszlo Papp wrote:
>> On Thu, Mar 20, 2014 at 7:59 PM, Burton, Ross <ross.burton@intel.com> wrote:
>> > On 20 March 2014 19:01, Laszlo Papp <lpapp@kde.org> wrote:
>> >> This init script is adding support for sysv and no more. This is also
>> >> indicated in the first line of the commit message. I am sorry, but I
>> >> will not test it systemd and with other systems
>> >
>> > You're not being asked to test with systemd.  You're being asked to
>> > add LSB-standard sysvinit-specific headers to a sysvinit script.
>>
>> In my understanding, people were referring to two issues:
>>
>> 1) not working with systemd and what not compat modes. This is not
>> something I will test any soon.
>
> Other people already know it's causing the issues without LSB headers,
> so if you just add them, you don't need to test it with systemd, other
> people who care about systemd will do that for you or at least be OK
> with adding this script, because it will have LSB headers (so it should
> work fine in systemd world).

If someone is really interested in systemd, et al, unlike me at this
point, I guess it is not a big deal to get an LSB header from someone
to get it integrated into my change?

If no one cares about that, then why bother? So, if someone sends this
to me I will integrate it, otherwise there is no point since that
means no one cares.

But then again, this should not still block the change as it can be
added incrementally. I am not sure if it is a good idea to block a
feature because it does not provide another feature, too.


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-03-22 14:03                           ` Laszlo Papp
@ 2014-07-25 13:32                             ` Laszlo Papp
  2015-03-01 13:48                               ` Laszlo Papp
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2014-07-25 13:32 UTC (permalink / raw)
  To: Martin Jansa; +Cc: Koen Kooi, Otavio Salvador, OE-core

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

Any reason why this feature has never got in? It was submitted more than
five months ago, and it would have added some feature to the system even if
not _everything_ right from the beginning?


On Sat, Mar 22, 2014 at 2:03 PM, Laszlo Papp <lpapp@kde.org> wrote:

> On Fri, Mar 21, 2014 at 2:39 PM, Martin Jansa <martin.jansa@gmail.com>
> wrote:
> > On Fri, Mar 21, 2014 at 01:59:15PM +0000, Laszlo Papp wrote:
> >> On Thu, Mar 20, 2014 at 7:59 PM, Burton, Ross <ross.burton@intel.com>
> wrote:
> >> > On 20 March 2014 19:01, Laszlo Papp <lpapp@kde.org> wrote:
> >> >> This init script is adding support for sysv and no more. This is also
> >> >> indicated in the first line of the commit message. I am sorry, but I
> >> >> will not test it systemd and with other systems
> >> >
> >> > You're not being asked to test with systemd.  You're being asked to
> >> > add LSB-standard sysvinit-specific headers to a sysvinit script.
> >>
> >> In my understanding, people were referring to two issues:
> >>
> >> 1) not working with systemd and what not compat modes. This is not
> >> something I will test any soon.
> >
> > Other people already know it's causing the issues without LSB headers,
> > so if you just add them, you don't need to test it with systemd, other
> > people who care about systemd will do that for you or at least be OK
> > with adding this script, because it will have LSB headers (so it should
> > work fine in systemd world).
>
> If someone is really interested in systemd, et al, unlike me at this
> point, I guess it is not a big deal to get an LSB header from someone
> to get it integrated into my change?
>
> If no one cares about that, then why bother? So, if someone sends this
> to me I will integrate it, otherwise there is no point since that
> means no one cares.
>
> But then again, this should not still block the change as it can be
> added incrementally. I am not sure if it is a good idea to block a
> feature because it does not provide another feature, too.
>

[-- Attachment #2: Type: text/html, Size: 2692 bytes --]

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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2014-07-25 13:32                             ` Laszlo Papp
@ 2015-03-01 13:48                               ` Laszlo Papp
  2015-03-01 21:34                                 ` Alexandre Belloni
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2015-03-01 13:48 UTC (permalink / raw)
  To: Martin Jansa; +Cc: Koen Kooi, Otavio Salvador, OE-core

I finally decided to get this patch another go, even though still no
busybox daemon has LSB headers, but I would need to ask for some prime
example of LSB headers that I can start off with. Could anyone please
provide me a good example for that from the Yocto project? Thanks.

On Fri, Jul 25, 2014 at 2:32 PM, Laszlo Papp <lpapp@kde.org> wrote:
> Any reason why this feature has never got in? It was submitted more than
> five months ago, and it would have added some feature to the system even if
> not _everything_ right from the beginning?
>
>
> On Sat, Mar 22, 2014 at 2:03 PM, Laszlo Papp <lpapp@kde.org> wrote:
>>
>> On Fri, Mar 21, 2014 at 2:39 PM, Martin Jansa <martin.jansa@gmail.com>
>> wrote:
>> > On Fri, Mar 21, 2014 at 01:59:15PM +0000, Laszlo Papp wrote:
>> >> On Thu, Mar 20, 2014 at 7:59 PM, Burton, Ross <ross.burton@intel.com>
>> >> wrote:
>> >> > On 20 March 2014 19:01, Laszlo Papp <lpapp@kde.org> wrote:
>> >> >> This init script is adding support for sysv and no more. This is
>> >> >> also
>> >> >> indicated in the first line of the commit message. I am sorry, but I
>> >> >> will not test it systemd and with other systems
>> >> >
>> >> > You're not being asked to test with systemd.  You're being asked to
>> >> > add LSB-standard sysvinit-specific headers to a sysvinit script.
>> >>
>> >> In my understanding, people were referring to two issues:
>> >>
>> >> 1) not working with systemd and what not compat modes. This is not
>> >> something I will test any soon.
>> >
>> > Other people already know it's causing the issues without LSB headers,
>> > so if you just add them, you don't need to test it with systemd, other
>> > people who care about systemd will do that for you or at least be OK
>> > with adding this script, because it will have LSB headers (so it should
>> > work fine in systemd world).
>>
>> If someone is really interested in systemd, et al, unlike me at this
>> point, I guess it is not a big deal to get an LSB header from someone
>> to get it integrated into my change?
>>
>> If no one cares about that, then why bother? So, if someone sends this
>> to me I will integrate it, otherwise there is no point since that
>> means no one cares.
>>
>> But then again, this should not still block the change as it can be
>> added incrementally. I am not sure if it is a good idea to block a
>> feature because it does not provide another feature, too.
>
>


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2015-03-01 13:48                               ` Laszlo Papp
@ 2015-03-01 21:34                                 ` Alexandre Belloni
  2015-03-02  9:54                                   ` Laszlo Papp
  0 siblings, 1 reply; 27+ messages in thread
From: Alexandre Belloni @ 2015-03-01 21:34 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Koen Kooi, Otavio Salvador, OE-core

On 01/03/2015 at 13:48:11 +0000, Laszlo Papp wrote :
> I finally decided to get this patch another go, even though still no
> busybox daemon has LSB headers, but I would need to ask for some prime
> example of LSB headers that I can start off with. Could anyone please
> provide me a good example for that from the Yocto project? Thanks.
> 

What about:

### BEGIN INIT INFO
# Provides:          ntpd
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: NTP daemon
# Description:       Network Time Protocol (NTP) is a networking
#                    protocol for clock synchronization 
### END INIT INFO

See
http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2015-03-01 21:34                                 ` Alexandre Belloni
@ 2015-03-02  9:54                                   ` Laszlo Papp
  0 siblings, 0 replies; 27+ messages in thread
From: Laszlo Papp @ 2015-03-02  9:54 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: Koen Kooi, Otavio Salvador, OE-core

On Sun, Mar 1, 2015 at 9:34 PM, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> On 01/03/2015 at 13:48:11 +0000, Laszlo Papp wrote :
>> I finally decided to get this patch another go, even though still no
>> busybox daemon has LSB headers, but I would need to ask for some prime
>> example of LSB headers that I can start off with. Could anyone please
>> provide me a good example for that from the Yocto project? Thanks.
>>
>
> What about:
>
> ### BEGIN INIT INFO
> # Provides:          ntpd
> # Required-Start:    $network
> # Required-Stop:     $network
> # Default-Start:     2 3 4 5
> # Default-Stop:      0 1 6
> # Short-Description: NTP daemon
> # Description:       Network Time Protocol (NTP) is a networking
> #                    protocol for clock synchronization
> ### END INIT INFO
>
> See
> http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html

I forgot to mention that Martin Jansa gave me a good example
yesterday. But thanks anyway. It is helpful.

>
>
> --
> Alexandre Belloni, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com


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

* Re: [PATCH] Add init script (sysv) support for busybox's ntpd
  2015-03-02 10:12 Laszlo Papp
@ 2015-03-02 18:15 ` Laszlo Papp
  0 siblings, 0 replies; 27+ messages in thread
From: Laszlo Papp @ 2015-03-02 18:15 UTC (permalink / raw)
  To: openembedded-core

On Mon, Mar 2, 2015 at 10:12 AM, Laszlo Papp <lpapp@kde.org> wrote:
> Signed-off-by: Laszlo Papp <laszlo.papp@polatis.com>
> ---
>  meta/recipes-core/busybox/busybox.inc             | 12 +++--
>  meta/recipes-core/busybox/busybox_1.23.1.bb       |  2 +
>  meta/recipes-core/busybox/files/busybox-ntpd      | 54 +++++++++++++++++++++++
>  meta/recipes-core/busybox/files/busybox-ntpd.conf |  2 +
>  4 files changed, 67 insertions(+), 3 deletions(-)
>  create mode 100644 meta/recipes-core/busybox/files/busybox-ntpd
>  create mode 100644 meta/recipes-core/busybox/files/busybox-ntpd.conf
>
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index 0769d92..b33d624 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -19,7 +19,7 @@ export EXTRA_CFLAGS = "${CFLAGS}"
>  export EXTRA_LDFLAGS = "${LDFLAGS}"
>  export EXTRA_OEMAKE += "'LD=${CCLD}'"
>
> -PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
> +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock ${PN}-ntpd"
>
>  FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
>  FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
> @@ -27,15 +27,17 @@ FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfd
>  FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
>  FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
>  FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
> +FILES_${PN}-ntpd = "${sysconfdir}/init.d/busybox-ntpd ${sysconfdir}/busybox-ntpd.conf"
>
> -INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
> +INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock ${PN}-ntpd"
>
>  INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
>  INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
>  INITSCRIPT_NAME_${PN}-mdev = "mdev"
>  INITSCRIPT_PARAMS_${PN}-mdev = "start 03 S ."
>  INITSCRIPT_NAME_${PN}-syslog = "syslog"
> -INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
> +INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
> +INITSCRIPT_NAME_${PN}-ntpd = "busybox-ntpd"
>
>  SYSTEMD_PACKAGES = "${PN}-syslog"
>  SYSTEMD_SERVICE_${PN}-syslog = "busybox-syslog.service"
> @@ -273,6 +275,10 @@ do_install () {
>                         install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
>                 fi
>         fi
> +    if grep "CONFIG_NTPD=y" ${B}/.config; then
> +        install -m 0755 ${WORKDIR}/busybox-ntpd ${D}${sysconfdir}/init.d/
> +        install -m 0644 ${WORKDIR}/busybox-ntpd.conf ${D}${sysconfdir}/
> +    fi
>
>      if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
>          if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
> diff --git a/meta/recipes-core/busybox/busybox_1.23.1.bb b/meta/recipes-core/busybox/busybox_1.23.1.bb
> index 1742390..8e57381 100644
> --- a/meta/recipes-core/busybox/busybox_1.23.1.bb
> +++ b/meta/recipes-core/busybox/busybox_1.23.1.bb
> @@ -31,6 +31,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
>             file://recognize_connmand.patch \
>             file://busybox-cross-menuconfig.patch \
>             file://CVE-2014-9645_busybox_reject_module_names_with_slashes.patch \
> +           file://busybox-ntpd \
> +           file://busybox-ntpd.conf \
>  "
>
>  SRC_URI[tarball.md5sum] = "5c94d6301a964cd91619bd4d74605245"
> diff --git a/meta/recipes-core/busybox/files/busybox-ntpd b/meta/recipes-core/busybox/files/busybox-ntpd
> new file mode 100644
> index 0000000..b318cda
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/busybox-ntpd
> @@ -0,0 +1,54 @@
> +#!/bin/sh
> +
> +### BEGIN INIT INFO
> +# Provides:
> +# Required-Start:    $local_fs $remote_fs $network $syslog
> +# Required-Stop:     $local_fs $remote_fs $network $syslog
> +# Default-Start:     2 3 4 5
> +# Default-Stop:      0 1 6
> +# Short-Description: Small busybox ntp server
> +# Description:       busybox-ntpd is a small and fast busybox ntp applet
> +### END INIT INFO
> +
> +DAEMON=/sbin/ntpd
> +NAME=ntpd
> +DESC="Busybox NTP Daemon"
> +source /etc/busybox-ntpd.conf
> +ARGS="-p $PEER"
> +
> +test -f $DAEMON || exit 0
> +
> +set -e
> +
> +case "$1" in
> +    start)
> +        if [ -z "$PEER" ]; then
> +            echo "PEER needs to be specified"
> +        else
> +            start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
> +            echo "done."
> +        fi
> +        ;;
> +    stop)
> +        echo -n "stopping $DESC: $NAME... "
> +        start-stop-daemon -K -n $NAME
> +        echo "done."
> +        ;;
> +    restart)
> +        echo "restarting $DESC: $NAME... "
> +        $0 stop
> +        $0 start
> +        echo "done."
> +        ;;
> +    reload)
> +        echo -n "reloading $DESC: $NAME... "
> +        killall -HUP $(basename ${DAEMON})
> +        echo "done."
> +        ;;
> +    *)
> +        echo "Usage: $0 {start|stop|restart|reload}"
> +        exit 1
> +        ;;
> +esac
> +
> +exit 0
> diff --git a/meta/recipes-core/busybox/files/busybox-ntpd.conf b/meta/recipes-core/busybox/files/busybox-ntpd.conf
> new file mode 100644
> index 0000000..9d9255c
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/busybox-ntpd.conf
> @@ -0,0 +1,2 @@
> +# Specify your peer.
> +# PEER=pool.ntp.org
> --
> 2.3.0

Actually after I raised this "hackish" approach on the busybox mailing
list last year, the maintainer seems to have liked my idea to get it
supported via proper configuration:
http://lists.busybox.net/pipermail/busybox-cvs/2014-March/034533.html

Therefore, I think my change ought to modified to reflect that logic.


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

* [PATCH] Add init script (sysv) support for busybox's ntpd
@ 2015-03-02 10:12 Laszlo Papp
  2015-03-02 18:15 ` Laszlo Papp
  0 siblings, 1 reply; 27+ messages in thread
From: Laszlo Papp @ 2015-03-02 10:12 UTC (permalink / raw)
  To: openembedded-core; +Cc: Laszlo Papp

Signed-off-by: Laszlo Papp <laszlo.papp@polatis.com>
---
 meta/recipes-core/busybox/busybox.inc             | 12 +++--
 meta/recipes-core/busybox/busybox_1.23.1.bb       |  2 +
 meta/recipes-core/busybox/files/busybox-ntpd      | 54 +++++++++++++++++++++++
 meta/recipes-core/busybox/files/busybox-ntpd.conf |  2 +
 4 files changed, 67 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-core/busybox/files/busybox-ntpd
 create mode 100644 meta/recipes-core/busybox/files/busybox-ntpd.conf

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 0769d92..b33d624 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -19,7 +19,7 @@ export EXTRA_CFLAGS = "${CFLAGS}"
 export EXTRA_LDFLAGS = "${LDFLAGS}"
 export EXTRA_OEMAKE += "'LD=${CCLD}'"
 
-PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
+PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock ${PN}-ntpd"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
 FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
@@ -27,15 +27,17 @@ FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfd
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
 FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
+FILES_${PN}-ntpd = "${sysconfdir}/init.d/busybox-ntpd ${sysconfdir}/busybox-ntpd.conf"
 
-INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock ${PN}-ntpd"
 
 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
 INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
 INITSCRIPT_NAME_${PN}-mdev = "mdev"
 INITSCRIPT_PARAMS_${PN}-mdev = "start 03 S ."
 INITSCRIPT_NAME_${PN}-syslog = "syslog"
-INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 
+INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
+INITSCRIPT_NAME_${PN}-ntpd = "busybox-ntpd"
 
 SYSTEMD_PACKAGES = "${PN}-syslog"
 SYSTEMD_SERVICE_${PN}-syslog = "busybox-syslog.service"
@@ -273,6 +275,10 @@ do_install () {
                        install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
                fi
 	fi
+    if grep "CONFIG_NTPD=y" ${B}/.config; then
+        install -m 0755 ${WORKDIR}/busybox-ntpd ${D}${sysconfdir}/init.d/
+        install -m 0644 ${WORKDIR}/busybox-ntpd.conf ${D}${sysconfdir}/
+    fi
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
         if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
diff --git a/meta/recipes-core/busybox/busybox_1.23.1.bb b/meta/recipes-core/busybox/busybox_1.23.1.bb
index 1742390..8e57381 100644
--- a/meta/recipes-core/busybox/busybox_1.23.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.23.1.bb
@@ -31,6 +31,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://recognize_connmand.patch \
            file://busybox-cross-menuconfig.patch \
            file://CVE-2014-9645_busybox_reject_module_names_with_slashes.patch \
+           file://busybox-ntpd \
+           file://busybox-ntpd.conf \
 "
 
 SRC_URI[tarball.md5sum] = "5c94d6301a964cd91619bd4d74605245"
diff --git a/meta/recipes-core/busybox/files/busybox-ntpd b/meta/recipes-core/busybox/files/busybox-ntpd
new file mode 100644
index 0000000..b318cda
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-ntpd
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start:    $local_fs $remote_fs $network $syslog
+# Required-Stop:     $local_fs $remote_fs $network $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Small busybox ntp server
+# Description:       busybox-ntpd is a small and fast busybox ntp applet
+### END INIT INFO
+
+DAEMON=/sbin/ntpd
+NAME=ntpd
+DESC="Busybox NTP Daemon"
+source /etc/busybox-ntpd.conf
+ARGS="-p $PEER"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+    start)
+        if [ -z "$PEER" ]; then
+            echo "PEER needs to be specified"
+        else
+            start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+            echo "done."
+        fi
+        ;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+        start-stop-daemon -K -n $NAME
+        echo "done."
+        ;;
+    restart)
+        echo "restarting $DESC: $NAME... "
+        $0 stop
+        $0 start
+        echo "done."
+        ;;
+    reload)
+        echo -n "reloading $DESC: $NAME... "
+        killall -HUP $(basename ${DAEMON})
+        echo "done."
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart|reload}"
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-ntpd.conf b/meta/recipes-core/busybox/files/busybox-ntpd.conf
new file mode 100644
index 0000000..9d9255c
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-ntpd.conf
@@ -0,0 +1,2 @@
+# Specify your peer.
+# PEER=pool.ntp.org
-- 
2.3.0



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

end of thread, other threads:[~2015-03-02 18:15 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-20  3:26 [PATCH] Add init script (sysv) support for busybox's ntpd Laszlo Papp
2014-03-20 10:45 ` Burton, Ross
2014-03-20 11:22   ` Koen Kooi
2014-03-20 11:34     ` Laszlo Papp
2014-03-20 11:59       ` Otavio Salvador
2014-03-20 12:16         ` Laszlo Papp
2014-03-20 12:26           ` Otavio Salvador
2014-03-20 12:44             ` Laszlo Papp
2014-03-20 13:28               ` Burton, Ross
2014-03-20 16:28                 ` Koen Kooi
2014-03-20 19:01                   ` Laszlo Papp
2014-03-20 19:59                     ` Burton, Ross
2014-03-21 13:59                       ` Laszlo Papp
2014-03-21 14:39                         ` Martin Jansa
2014-03-22 14:03                           ` Laszlo Papp
2014-07-25 13:32                             ` Laszlo Papp
2015-03-01 13:48                               ` Laszlo Papp
2015-03-01 21:34                                 ` Alexandre Belloni
2015-03-02  9:54                                   ` Laszlo Papp
2014-03-20 18:49                 ` Laszlo Papp
2014-03-20 18:53                   ` Otavio Salvador
2014-03-20 18:53                   ` Laszlo Papp
2014-03-20 13:30               ` Martin Jansa
2014-03-20 16:42           ` Khem Raj
2014-03-20 11:34   ` Laszlo Papp
2015-03-02 10:12 Laszlo Papp
2015-03-02 18:15 ` Laszlo Papp

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.