* [meta-networking][PATCH V2 0/2] ntp: Resolve some abnormal behaviors
@ 2014-03-11 5:54 Xufeng Zhang
2014-03-11 5:54 ` [PATCH 1/2] ntp: Running ntpd daemon as ntp:ntp Xufeng Zhang
2014-03-11 5:54 ` [PATCH 2/2] ntp: Moving relevant files from /usr/bin to /usr/sbin Xufeng Zhang
0 siblings, 2 replies; 4+ messages in thread
From: Xufeng Zhang @ 2014-03-11 5:54 UTC (permalink / raw)
To: openembedded-devel
Subject: [oe][meta-networking][PATCH V2 0/2] ntp: Resolve some abnormal behaviors
Changes from V1:
1). Split the original one patch into two patches.
2). Remove crypto default support.
3). Use "/var/lib/ntp" as home-dir.
Thanks,
Xufeng
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ntp: Running ntpd daemon as ntp:ntp
2014-03-11 5:54 [meta-networking][PATCH V2 0/2] ntp: Resolve some abnormal behaviors Xufeng Zhang
@ 2014-03-11 5:54 ` Xufeng Zhang
2014-03-14 14:30 ` Joe MacDonald
2014-03-11 5:54 ` [PATCH 2/2] ntp: Moving relevant files from /usr/bin to /usr/sbin Xufeng Zhang
1 sibling, 1 reply; 4+ messages in thread
From: Xufeng Zhang @ 2014-03-11 5:54 UTC (permalink / raw)
To: openembedded-devel
Adding ntp:ntp(user:group) to system and running
ntpd dameon as ntp:ntp.
Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
---
meta-networking/recipes-support/ntp/files/ntpd | 2 +-
meta-networking/recipes-support/ntp/ntp.inc | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta-networking/recipes-support/ntp/files/ntpd b/meta-networking/recipes-support/ntp/files/ntpd
index 53fa2d1..f1e78aa 100755
--- a/meta-networking/recipes-support/ntp/files/ntpd
+++ b/meta-networking/recipes-support/ntp/files/ntpd
@@ -23,7 +23,7 @@ startdaemon(){
# this. If ntpd seems to disappear after a while assume TICKADJ
# above is set to a totally incorrect value.
echo -n "Starting ntpd: "
- start-stop-daemon --start -x /usr/bin/ntpd -- -p /var/run/ntp.pid "$@"
+ start-stop-daemon --start -x /usr/bin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
echo "done"
}
stopdaemon(){
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index 8381b9e..7876c0b 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -25,13 +25,17 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g
file://ntpd.list \
"
-inherit autotools update-rc.d systemd
+inherit autotools update-rc.d useradd systemd
# The ac_cv_header_readline_history is to stop ntpdc depending on either
# readline or curses
EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no"
CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ntp \
+ --shell /bin/false --user-group ntp"
+
PACKAGECONFIG ??= ""
PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
--with-openssl-incdir=${STAGING_INCDIR} \
--
1.7.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ntp: Moving relevant files from /usr/bin to /usr/sbin
2014-03-11 5:54 [meta-networking][PATCH V2 0/2] ntp: Resolve some abnormal behaviors Xufeng Zhang
2014-03-11 5:54 ` [PATCH 1/2] ntp: Running ntpd daemon as ntp:ntp Xufeng Zhang
@ 2014-03-11 5:54 ` Xufeng Zhang
1 sibling, 0 replies; 4+ messages in thread
From: Xufeng Zhang @ 2014-03-11 5:54 UTC (permalink / raw)
To: openembedded-devel
"--with-binsubdir" controls whether we use bin_PROGRAMS or
sbin_PROGRAMS while installing executable files in ntp
Makefile, in order to install all the relevant files in
/usr/sbin instead of /usr/bin, we can pass "--with-binsubdir=sbin"
in ntp configure cmdline.
Accordingly, updating the path for the files which are
contained in rpm packages.
Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
---
meta-networking/recipes-support/ntp/files/ntpd | 8 ++++----
meta-networking/recipes-support/ntp/files/ntpdate | 6 +++---
meta-networking/recipes-support/ntp/ntp.inc | 12 ++++++------
.../recipes-support/ntp/ntp/ntpd.service | 2 +-
.../recipes-support/ntp/ntp/sntp.service | 2 +-
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/meta-networking/recipes-support/ntp/files/ntpd b/meta-networking/recipes-support/ntp/files/ntpd
index f1e78aa..a62b8ce 100755
--- a/meta-networking/recipes-support/ntp/files/ntpd
+++ b/meta-networking/recipes-support/ntp/files/ntpd
@@ -3,7 +3,7 @@
PATH=/sbin:/bin:/usr/bin:/usr/sbin
# ntpd init.d script for ntpdc from ntp.isc.org
-test -x /usr/bin/ntpd -a -r /etc/ntp.conf || exit 0
+test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0
# rcS contains TICKADJ
test -r /etc/default/rcS && . /etc/default/rcS
@@ -11,9 +11,9 @@ test -r /etc/default/rcS && . /etc/default/rcS
settick(){
# If TICKADJ is set we *must* adjust it before we start, because the
# driftfile relies on the correct setting
- test -n "$TICKADJ" -a -x /usr/bin/tickadj && {
+ test -n "$TICKADJ" -a -x /usr/sbin/tickadj && {
echo -n "Setting tick to $TICKADJ: "
- /usr/bin/tickadj "$TICKADJ"
+ /usr/sbin/tickadj "$TICKADJ"
echo "done"
}
}
@@ -23,7 +23,7 @@ startdaemon(){
# this. If ntpd seems to disappear after a while assume TICKADJ
# above is set to a totally incorrect value.
echo -n "Starting ntpd: "
- start-stop-daemon --start -x /usr/bin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
+ start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
echo "done"
}
stopdaemon(){
diff --git a/meta-networking/recipes-support/ntp/files/ntpdate b/meta-networking/recipes-support/ntp/files/ntpdate
index ab0551c..17b64d1 100755
--- a/meta-networking/recipes-support/ntp/files/ntpdate
+++ b/meta-networking/recipes-support/ntp/files/ntpdate
@@ -1,8 +1,8 @@
#!/bin/sh
-PATH=/sbin:/bin:/usr/bin
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
-test -x /usr/bin/ntpdate || exit 0
+test -x /usr/sbin/ntpdate || exit 0
if test -f /etc/default/ntpdate ; then
. /etc/default/ntpdate
@@ -40,7 +40,7 @@ if [ -x /usr/bin/lockfile-create ]; then
LOCKTOUCHPID="$!"
fi
-if /usr/bin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then
+if /usr/sbin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then
if [ "$UPDATE_HWCLOCK" = "yes" ]; then
hwclock --systohc || :
fi
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
index 7876c0b..9c3e0d1 100644
--- a/meta-networking/recipes-support/ntp/ntp.inc
+++ b/meta-networking/recipes-support/ntp/ntp.inc
@@ -29,7 +29,7 @@ inherit autotools update-rc.d useradd systemd
# The ac_cv_header_readline_history is to stop ntpdc depending on either
# readline or curses
-EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no"
+EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no --with-binsubdir=sbin"
CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
USERADD_PACKAGES = "${PN}"
@@ -101,18 +101,18 @@ RCONFLICTS_ntpdate += "ntpdate-systemd"
RSUGGESTS_${PN} = "iana-etc"
-FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir} \
+FILES_${PN} = "${sbindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \
${systemd_unitdir}/ntp-units.d/60-ntpd.list \
"
-FILES_${PN}-tickadj = "${bindir}/tickadj"
-FILES_${PN}-utils = "${bindir}"
-FILES_ntpdate = "${bindir}/ntpdate \
+FILES_${PN}-tickadj = "${sbindir}/tickadj"
+FILES_${PN}-utils = "${sbindir}"
+FILES_ntpdate = "${sbindir}/ntpdate \
${sysconfdir}/network/if-up.d/ntpdate-sync \
${bindir}/ntpdate-sync \
${sysconfdir}/default/ntpdate \
${systemd_unitdir}/system/ntpdate.service \
"
-FILES_sntp = "${bindir}/sntp \
+FILES_sntp = "${sbindir}/sntp \
${sysconfdir}/default/sntp \
"
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.service b/meta-networking/recipes-support/ntp/ntp/ntpd.service
index eb9c030..b7c4268 100644
--- a/meta-networking/recipes-support/ntp/ntp/ntpd.service
+++ b/meta-networking/recipes-support/ntp/ntp/ntpd.service
@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=forking
PIDFile=/run/ntpd.pid
-ExecStart=/usr/bin/ntpd -p /run/ntpd.pid -g
+ExecStart=/usr/sbin/ntpd -p /run/ntpd.pid -g
[Install]
WantedBy=multi-user.target
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-networking/recipes-support/ntp/ntp/sntp.service
index 0f09e43..4898b8a 100644
--- a/meta-networking/recipes-support/ntp/ntp/sntp.service
+++ b/meta-networking/recipes-support/ntp/ntp/sntp.service
@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=oneshot
EnvironmentFile=-/etc/default/sntp
-ExecStart=/usr/bin/sntp -s $NTPSERVER
+ExecStart=/usr/sbin/sntp -s $NTPSERVER
[Install]
WantedBy=multi-user.target
--
1.7.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ntp: Running ntpd daemon as ntp:ntp
2014-03-11 5:54 ` [PATCH 1/2] ntp: Running ntpd daemon as ntp:ntp Xufeng Zhang
@ 2014-03-14 14:30 ` Joe MacDonald
0 siblings, 0 replies; 4+ messages in thread
From: Joe MacDonald @ 2014-03-14 14:30 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]
Merged both of these. Thanks.
-J.
[[oe] [PATCH 1/2] ntp: Running ntpd daemon as ntp:ntp] On 14.03.11 (Tue 13:54) Xufeng Zhang wrote:
> Adding ntp:ntp(user:group) to system and running
> ntpd dameon as ntp:ntp.
>
> Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
> ---
> meta-networking/recipes-support/ntp/files/ntpd | 2 +-
> meta-networking/recipes-support/ntp/ntp.inc | 6 +++++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/meta-networking/recipes-support/ntp/files/ntpd b/meta-networking/recipes-support/ntp/files/ntpd
> index 53fa2d1..f1e78aa 100755
> --- a/meta-networking/recipes-support/ntp/files/ntpd
> +++ b/meta-networking/recipes-support/ntp/files/ntpd
> @@ -23,7 +23,7 @@ startdaemon(){
> # this. If ntpd seems to disappear after a while assume TICKADJ
> # above is set to a totally incorrect value.
> echo -n "Starting ntpd: "
> - start-stop-daemon --start -x /usr/bin/ntpd -- -p /var/run/ntp.pid "$@"
> + start-stop-daemon --start -x /usr/bin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
> echo "done"
> }
> stopdaemon(){
> diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc
> index 8381b9e..7876c0b 100644
> --- a/meta-networking/recipes-support/ntp/ntp.inc
> +++ b/meta-networking/recipes-support/ntp/ntp.inc
> @@ -25,13 +25,17 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g
> file://ntpd.list \
> "
>
> -inherit autotools update-rc.d systemd
> +inherit autotools update-rc.d useradd systemd
>
> # The ac_cv_header_readline_history is to stop ntpdc depending on either
> # readline or curses
> EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no"
> CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
>
> +USERADD_PACKAGES = "${PN}"
> +USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ntp \
> + --shell /bin/false --user-group ntp"
> +
> PACKAGECONFIG ??= ""
> PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
> --with-openssl-incdir=${STAGING_INCDIR} \
> --
> 1.7.0.2
>
--
-Joe MacDonald.
:wq
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-14 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 5:54 [meta-networking][PATCH V2 0/2] ntp: Resolve some abnormal behaviors Xufeng Zhang
2014-03-11 5:54 ` [PATCH 1/2] ntp: Running ntpd daemon as ntp:ntp Xufeng Zhang
2014-03-14 14:30 ` Joe MacDonald
2014-03-11 5:54 ` [PATCH 2/2] ntp: Moving relevant files from /usr/bin to /usr/sbin Xufeng Zhang
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.