* [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting
@ 2011-05-28 11:21 Koen Kooi
2011-05-30 11:45 ` Koen Kooi
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Koen Kooi @ 2011-05-28 11:21 UTC (permalink / raw)
To: openembedded-core; +Cc: Koen Kooi
Currently it's a symlink to killall5:
$ dpkg-deb -c sysvinit-pidof_2.88dsf-r1_armv7a.ipk | grep pidof
lrwxrwxrwx root/root 0 2011-05-27 11:05 ./bin/pidof.sysvinit -> /sbin/killall5
The point of the pidof subpackage was to have a pidof without needing sysvinit, this restores that behaviour. The trade-off is a 14KiB (armv7a, uncompressed) increase in size.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
The alternative is to just move 'killall5' into the pidof subpackage and to RDPEPENDS_${PN} += "${PN}-pidof"
The change in this patch was the least amounts of edits to the recipe, let me know which way you prefer.
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
index 7d5e936..f0e73bb 100644
--- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -5,7 +5,7 @@ SECTION = "base"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
-PR = "r1"
+PR = "r2"
# USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
# Set PACKAGE_ARCH appropriately.
@@ -100,7 +100,7 @@ EOF
ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd
done
mv ${D}${base_sbindir}/init ${D}${base_sbindir}/init.${PN}
- mv ${D}${base_bindir}/pidof ${D}${base_bindir}/pidof.${PN}
+ cp ${D}${base_sbindir}/killall5 ${D}${base_bindir}/pidof.${PN}
mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN}
mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN}
mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting
2011-05-28 11:21 [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting Koen Kooi
@ 2011-05-30 11:45 ` Koen Kooi
2011-05-31 8:27 ` Koen Kooi
2011-05-31 9:27 ` Phil Blundell
2 siblings, 0 replies; 5+ messages in thread
From: Koen Kooi @ 2011-05-30 11:45 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
ping
Op 28 mei 2011, om 13:21 heeft Koen Kooi het volgende geschreven:
> Currently it's a symlink to killall5:
>
> $ dpkg-deb -c sysvinit-pidof_2.88dsf-r1_armv7a.ipk | grep pidof
> lrwxrwxrwx root/root 0 2011-05-27 11:05 ./bin/pidof.sysvinit -> /sbin/killall5
>
> The point of the pidof subpackage was to have a pidof without needing sysvinit, this restores that behaviour. The trade-off is a 14KiB (armv7a, uncompressed) increase in size.
>
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
>
> The alternative is to just move 'killall5' into the pidof subpackage and to RDPEPENDS_${PN} += "${PN}-pidof"
>
> The change in this patch was the least amounts of edits to the recipe, let me know which way you prefer.
>
> meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> index 7d5e936..f0e73bb 100644
> --- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> +++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> @@ -5,7 +5,7 @@ SECTION = "base"
> LICENSE = "GPLv2+"
> LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
> file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
> -PR = "r1"
> +PR = "r2"
>
> # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
> # Set PACKAGE_ARCH appropriately.
> @@ -100,7 +100,7 @@ EOF
> ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd
> done
> mv ${D}${base_sbindir}/init ${D}${base_sbindir}/init.${PN}
> - mv ${D}${base_bindir}/pidof ${D}${base_bindir}/pidof.${PN}
> + cp ${D}${base_sbindir}/killall5 ${D}${base_bindir}/pidof.${PN}
> mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN}
> mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN}
> mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
> --
> 1.6.6.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting
2011-05-28 11:21 [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting Koen Kooi
2011-05-30 11:45 ` Koen Kooi
@ 2011-05-31 8:27 ` Koen Kooi
2011-05-31 8:59 ` Richard Purdie
2011-05-31 9:27 ` Phil Blundell
2 siblings, 1 reply; 5+ messages in thread
From: Koen Kooi @ 2011-05-31 8:27 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
No comments at all?
Op 28 mei 2011, om 13:21 heeft Koen Kooi het volgende geschreven:
> Currently it's a symlink to killall5:
>
> $ dpkg-deb -c sysvinit-pidof_2.88dsf-r1_armv7a.ipk | grep pidof
> lrwxrwxrwx root/root 0 2011-05-27 11:05 ./bin/pidof.sysvinit -> /sbin/killall5
>
> The point of the pidof subpackage was to have a pidof without needing sysvinit, this restores that behaviour. The trade-off is a 14KiB (armv7a, uncompressed) increase in size.
>
> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> ---
>
> The alternative is to just move 'killall5' into the pidof subpackage and to RDPEPENDS_${PN} += "${PN}-pidof"
>
> The change in this patch was the least amounts of edits to the recipe, let me know which way you prefer.
>
> meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> index 7d5e936..f0e73bb 100644
> --- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> +++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> @@ -5,7 +5,7 @@ SECTION = "base"
> LICENSE = "GPLv2+"
> LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
> file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
> -PR = "r1"
> +PR = "r2"
>
> # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
> # Set PACKAGE_ARCH appropriately.
> @@ -100,7 +100,7 @@ EOF
> ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd
> done
> mv ${D}${base_sbindir}/init ${D}${base_sbindir}/init.${PN}
> - mv ${D}${base_bindir}/pidof ${D}${base_bindir}/pidof.${PN}
> + cp ${D}${base_sbindir}/killall5 ${D}${base_bindir}/pidof.${PN}
> mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN}
> mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN}
> mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
> --
> 1.6.6.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting
2011-05-31 8:27 ` Koen Kooi
@ 2011-05-31 8:59 ` Richard Purdie
0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2011-05-31 8:59 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, 2011-05-31 at 10:27 +0200, Koen Kooi wrote:
> No comments at all?
Patience ;-). It was a US/UK holiday yesterday and lots of people have
been taking a long weekend. Personally, whilst I did merge a few things
yesterday, this one didn't look that urgent so its on today's to look at
and reply to list.
> Op 28 mei 2011, om 13:21 heeft Koen Kooi het volgende geschreven:
>
> > Currently it's a symlink to killall5:
> >
> > $ dpkg-deb -c sysvinit-pidof_2.88dsf-r1_armv7a.ipk | grep pidof
> > lrwxrwxrwx root/root 0 2011-05-27 11:05 ./bin/pidof.sysvinit -> /sbin/killall5
> >
> > The point of the pidof subpackage was to have a pidof without
> needing sysvinit, this restores that behaviour. The trade-off is a
> 14KiB (armv7a, uncompressed) increase in size.
> >
> > Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> > ---
> >
> > The alternative is to just move 'killall5' into the pidof subpackage and to RDPEPENDS_${PN} += "${PN}-pidof"
I think I prefer the alternative to duplicating binaries...
Cheers,
Richard
> > The change in this patch was the least amounts of edits to the recipe, let me know which way you prefer.
> >
> > meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> > index 7d5e936..f0e73bb 100644
> > --- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> > +++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
> > @@ -5,7 +5,7 @@ SECTION = "base"
> > LICENSE = "GPLv2+"
> > LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
> > file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
> > -PR = "r1"
> > +PR = "r2"
> >
> > # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
> > # Set PACKAGE_ARCH appropriately.
> > @@ -100,7 +100,7 @@ EOF
> > ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd
> > done
> > mv ${D}${base_sbindir}/init ${D}${base_sbindir}/init.${PN}
> > - mv ${D}${base_bindir}/pidof ${D}${base_bindir}/pidof.${PN}
> > + cp ${D}${base_sbindir}/killall5 ${D}${base_bindir}/pidof.${PN}
> > mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN}
> > mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN}
> > mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
> > --
> > 1.6.6.1
> >
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting
2011-05-28 11:21 [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting Koen Kooi
2011-05-30 11:45 ` Koen Kooi
2011-05-31 8:27 ` Koen Kooi
@ 2011-05-31 9:27 ` Phil Blundell
2 siblings, 0 replies; 5+ messages in thread
From: Phil Blundell @ 2011-05-31 9:27 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Koen Kooi
On Sat, 2011-05-28 at 13:21 +0200, Koen Kooi wrote:
> The alternative is to just move 'killall5' into the pidof subpackage and to RDPEPENDS_${PN} += "${PN}-pidof"
I think I like that better. Duplicating the binary doesn't sound very
desirable.
For what it's worth, also note that:
- busybox provides an implementation of pidof too, which might be worth
considering if you aren't otherwise using sysvinit; and
- it would be fairly trivial to implement pidof as a standalone shell
script. As a starting point, something like:
#!/bin/sh
p="($1)"
cd /proc
out=
for i in [0123456789]*/stat; do
read a b c < $i
if [ $p = $b ]; then
out="`dirname $i` $out"
fi
done
echo $out
gives you the basic behaviour of "pidof <name>".
p.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-31 9:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-28 11:21 [RFC][PATCH] sysvinit: make pidof usuable in a standalone setting Koen Kooi
2011-05-30 11:45 ` Koen Kooi
2011-05-31 8:27 ` Koen Kooi
2011-05-31 8:59 ` Richard Purdie
2011-05-31 9:27 ` Phil Blundell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox