All of lore.kernel.org
 help / color / mirror / Atom feed
From: randy.e.witt@linux.intel.com
To: "Khem Raj" <raj.khem@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] systemd: Instruct the journal to always be volatile
Date: Wed, 11 Mar 2015 21:18:38 -0700 (PDT)	[thread overview]
Message-ID: <60821.10.252.136.167.1426133918.squirrel@linux.intel.com> (raw)
In-Reply-To: <13FDACD4-FC30-49CD-AC52-9D614F407C5D@gmail.com>

>
>> On Mar 11, 2015, at 2:28 PM, Randy Witt <randy.e.witt@linux.intel.com>
>> wrote:
>>
>> When the storage mode for the journal is "auto" if /var/log/journal
>> exists then the journal will flush to /var/log/journal assuming that
>> /var/log/journal is persistent.
>>
>> However /var/log -> /var/volatile/log in poky, so even though
>> /var/log/journal exists, it is still volatile.
>>
>> Since this can cause ordering issues due to /var/volatile needing to be
>> mounted before the journal actually writes to it, just specify that the
>> journal
>> should always be volatile and never try to write to "persistent"
>> storage. The journal will exist in /run/log/journal only.
>>
>> This also disables the "After" of the journal on var-volatile.mount
>> since the ordering is no longer necessary when the journal is only
>> stored in /run/log/journal.
>>
>> [Yocto #7388]
>
>
> This is not right. What if I want persistent logs.? the options is just
> gone. Both cases should work. /var/volatile should only be used
> when doing ro-rfs its not FHS specified anyway. Lets not go with this
> patch.
The distro could still change it with a bbappend or additional
configuration files just like other settings. We don't have an option for
a persistent journal so I'm curious, how would both cases work currently?

Currently if a persistent journal is desired, the /var/log symlink has to
be changed to point to persistent storage, or /var/volatile has to be
dropped from /etc/fstab. These are also configuration changes.

The lesser of the two evils seems to be making it so that the journal
works in the volatile case, which is all we've ever supported in poky. If
a user wanted a non-volatile journal it was left to them to do.

I agree that the journal should be persistent, but I also agree with
Richard that seems to be too big of a change in behavior when we're so
close to the release point.

>>
>> Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
>> ---
>> meta/recipes-core/systemd/systemd/journald-volatile.conf | 6 ------
>> meta/recipes-core/systemd/systemd_219.bb                 | 4 ++--
>> 2 files changed, 2 insertions(+), 8 deletions(-)
>> delete mode 100644
>> meta/recipes-core/systemd/systemd/journald-volatile.conf
>>
>> diff --git a/meta/recipes-core/systemd/systemd/journald-volatile.conf
>> b/meta/recipes-core/systemd/systemd/journald-volatile.conf
>> deleted file mode 100644
>> index b11e160..0000000
>> --- a/meta/recipes-core/systemd/systemd/journald-volatile.conf
>> +++ /dev/null
>> @@ -1,6 +0,0 @@
>> -# If /var/volatile is a mount point then make sure to mount it before
>> -# the journal starts. This is because base-files creates a symlink
>> -# /var/log -> /var/volatile/log. And if the journal starts before the
>> mount
>> -# happens, the journal will appear empty until restarted.
>> -[Unit]
>> -After=var-volatile.mount
>> diff --git a/meta/recipes-core/systemd/systemd_219.bb
>> b/meta/recipes-core/systemd/systemd_219.bb
>> index d5eed08..f3bb0c4 100644
>> --- a/meta/recipes-core/systemd/systemd_219.bb
>> +++ b/meta/recipes-core/systemd/systemd_219.bb
>> @@ -48,7 +48,6 @@ SRC_URI =
>> "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=
>>            file://00-create-volatile.conf \
>>            file://init \
>>            file://run-ptest \
>> -           file://journald-volatile.conf \
>>           "
>>
>> S = "${WORKDIR}/git"
>> @@ -145,7 +144,6 @@ do_install() {
>> 	install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
>>
>> 	install -m 0644 ${WORKDIR}/00-create-volatile.conf
>> ${D}${sysconfdir}/tmpfiles.d/
>> -	install -D -m 0644 ${WORKDIR}/journald-volatile.conf
>> ${D}${systemd_unitdir}/system/systemd-journald.service.d/journald-volatile.conf
>>
>> 	if
>> ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)};
>> then
>> 		install -d ${D}${sysconfdir}/init.d
>> @@ -170,6 +168,8 @@ do_install() {
>>
>> 	# Enable journal to forward message to syslog daemon
>> 	sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/'
>> ${D}${sysconfdir}/systemd/journald.conf
>> +	# Make the journal volatile by default.
>> +	sed -i -e 's/.*Storage.*/Storage=volatile/'
>> ${D}${sysconfdir}/systemd/journald.conf
>> 	# its needed in 216 upstream has fixed it with
>> 919699ec301ea507edce4a619141ed22e789ac0d
>> 	# don't order journal flushing afte remote-fs.target
>> 	sed -i -e 's/ remote-fs.target$//'
>> ${D}${systemd_unitdir}/system/systemd-journal-flush.service
>> --
>> 1.9.3
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>



  reply	other threads:[~2015-03-12  4:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 21:28 [PATCH] systemd: Instruct the journal to always be volatile Randy Witt
2015-03-12  3:09 ` Khem Raj
2015-03-12  4:18   ` randy.e.witt [this message]
2015-03-12  4:56     ` Khem Raj
2015-03-12  7:18   ` Otavio Salvador
2015-03-12  8:04     ` Richard Purdie
2015-03-12  8:13       ` Otavio Salvador
2015-03-12  8:40       ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60821.10.252.136.167.1426133918.squirrel@linux.intel.com \
    --to=randy.e.witt@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.