Patchwork [meta-oe,3/3] systemd: enable logging to disk instead of tmpfs

login
register
mail settings
Submitter Koen Kooi
Date March 5, 2012, 5:37 p.m.
Message ID <1330969051-9867-3-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/22711/
State New, archived
Headers show

Comments

Koen Kooi - March 5, 2012, 5:37 p.m.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta-oe/recipes-core/systemd/systemd_git.bb |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
Otavio Salvador - March 5, 2012, 6:12 p.m.
On Mon, Mar 5, 2012 at 14:37, Koen Kooi <koen@dominion.thruhere.net> wrote:
> +       # create dir for journal
> +       install -d ${D}${localstatedir}/log/journal

I'd prefer if journal could default to use a buffer or something
similar instead of writting to disk as we ought to be careful about
space in embedded devices, in general.
Koen Kooi - March 5, 2012, 8:29 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 05-03-12 19:12, Otavio Salvador schreef:
> On Mon, Mar 5, 2012 at 14:37, Koen Kooi <koen@dominion.thruhere.net>
> wrote:
>> +       # create dir for journal +       install -d
>> ${D}${localstatedir}/log/journal
> 
> I'd prefer if journal could default to use a buffer or something similar
> instead of writting to disk as we ought to be careful about space in
> embedded devices, in general.

And that's why patch 1/3 enables xz compression :)

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAk9VIg0ACgkQMkyGM64RGpH14QCbBuH7m537WtbnT6RdxR1O15CF
FTMAmQHZzg42rc/O0OLPmllHAYeDAe5y
=3Zig
-----END PGP SIGNATURE-----
Otavio Salvador - March 5, 2012, 8:55 p.m.
On Mon, Mar 5, 2012 at 17:29, Koen Kooi <koen@dominion.thruhere.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Op 05-03-12 19:12, Otavio Salvador schreef:
>> On Mon, Mar 5, 2012 at 14:37, Koen Kooi <koen@dominion.thruhere.net>
>> wrote:
>>> +       # create dir for journal +       install -d
>>> ${D}${localstatedir}/log/journal
>>
>> I'd prefer if journal could default to use a buffer or something similar
>> instead of writting to disk as we ought to be careful about space in
>> embedded devices, in general.
>
> And that's why patch 1/3 enables xz compression :)

I understand however I think that write the log to the disk by default
is wrong. We can do it by machine basis or other type of override by
by default we ought to avoid writting to disk.
Koen Kooi - March 5, 2012, 9:32 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 05-03-12 21:55, Otavio Salvador schreef:
> On Mon, Mar 5, 2012 at 17:29, Koen Kooi <koen@dominion.thruhere.net>
> wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>> 
>> Op 05-03-12 19:12, Otavio Salvador schreef:
>>> On Mon, Mar 5, 2012 at 14:37, Koen Kooi <koen@dominion.thruhere.net> 
>>> wrote:
>>>> +       # create dir for journal +       install -d 
>>>> ${D}${localstatedir}/log/journal
>>> 
>>> I'd prefer if journal could default to use a buffer or something
>>> similar instead of writting to disk as we ought to be careful about
>>> space in embedded devices, in general.
>> 
>> And that's why patch 1/3 enables xz compression :)
> 
> I understand however I think that write the log to the disk by default is
> wrong. We can do it by machine basis or other type of override by by
> default we ought to avoid writting to disk.

Right now it's logging to tmpfs, which takes up ram, which more scarce than
disk. You can easily remove /var/log/journal in ROOTFS_POSTPROCESS_CMD to
make it log to tmpfs again.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAk9VMQgACgkQMkyGM64RGpErSwCfZpPPFTm/pOM6926bD7IYh3JV
TjEAoI6cWZX5RdaT/ArpIf14+/yqXif3
=CY6W
-----END PGP SIGNATURE-----
Otavio Salvador - March 5, 2012, 9:52 p.m.
On Mon, Mar 5, 2012 at 18:32, Koen Kooi <koen@dominion.thruhere.net> wrote:
> Right now it's logging to tmpfs, which takes up ram, which more scarce than
> disk. You can easily remove /var/log/journal in ROOTFS_POSTPROCESS_CMD to
> make it log to tmpfs again.

In both cases it is doing the wrong thing IMO; a circular buffer would
be the right thing for a default.

Patch

diff --git a/meta-oe/recipes-core/systemd/systemd_git.bb b/meta-oe/recipes-core/systemd/systemd_git.bb
index 7a8f6e4..2a3b118 100644
--- a/meta-oe/recipes-core/systemd/systemd_git.bb
+++ b/meta-oe/recipes-core/systemd/systemd_git.bb
@@ -14,7 +14,7 @@  inherit gitpkgv
 PKGV = "v${GITPKGVTAG}"
 
 PV = "git"
-PR = "r19"
+PR = "r20"
 
 inherit useradd pkgconfig autotools vala perlnative
 
@@ -58,6 +58,9 @@  do_install() {
 
 	# provide support for initramfs
 	ln -s ${base_libdir}/systemd/systemd ${D}/init
+
+	# create dir for journal
+	install -d ${D}${localstatedir}/log/journal
 }
 
 python populate_packages_prepend (){