[opensuse] problem with journalctl
Hello, I have a crash problem with a particular application, so I wanted to look at the kernel logs. then I noticed journalctl do not works as expected. LANG=US ; journalctl (wait then press end and wait again) stops at Feb 5: Feb 05 14:11:07 linux-us26 sddm[1114]: Auth: sddm-helper crashed (exit code 15) no idea if the fact it's a crash have a relation with the present problem. LANG=US ; journalctl -b 0 gives May 3, present boot logs. but LANG=US ; journalctl -b -1 gives: Feb 05 00:17:50 linux-us26 systemd-journal[445]: Journal stopped again Feb 5, but not same hour. How can I reset my journal? thanks jdd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, May 3, 2016 at 1:53 AM, jdd
Hello,
I have a crash problem with a particular application, so I wanted to look at the kernel logs.
then I noticed journalctl do not works as expected.
LANG=US ; journalctl
(wait then press end and wait again) stops at Feb 5:
Feb 05 14:11:07 linux-us26 sddm[1114]: Auth: sddm-helper crashed (exit code 15)
no idea if the fact it's a crash have a relation with the present problem.
LANG=US ; journalctl -b 0
gives May 3, present boot logs.
but
LANG=US ; journalctl -b -1
gives:
Feb 05 00:17:50 linux-us26 systemd-journal[445]: Journal stopped
again Feb 5, but not same hour.
How can I reset my journal?
This is probably a journalctl parsing bug, I've run into a similar problem. [1] What's supposed to happen is any corrupt entries in the journal are ignored but intact entries can still be read OK. What actually happens for some reason is the journal playback gets confused. There may be more than one upstream partial fix for this so it's probably worth filing a bug and asking if it's useful to attach an example journal that manifests the problem. As far as I'm aware there's no way to fix the journal itself, the problem is in reading the journal. In my case it was always a time based filter such as -b or --since, so as long as I didn't use those, the journal readback was reliable. That means filtering some other way like piping it to grep or whatever you're familiar with. An alternative is to do something like 'journalctl > journal_all.log' to effectively export everything to a text file, and then blow away everything in /var/log/journal/<machineid>/ and restart journald or just reboot. Variations with journalctl output are possible depending on what you want to keep. If you just want something human readable the default is good. There are other output options with -o that might be useful for more sophisticated searches and backup needs. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1294002 -- Chris Murphy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello Nothing indicated worked, but I found sort of a fix. First, the loga are in /var/log/journal. I use to move parts I want to "remove" with a backup :-). When I move this folder, it's *not* recreated at boot. I guess the "Storage" option in /etc/systemd/journald.conf is auto. Changing it to "persistent" makes the journal to be read again. journalctl -b 0 is probably stored in ram (/var/run ?) and with the default setup, there is nothing kept after a reboot is /var/log/journal is removed. I keep it like this now. But to experiment I runned a journalctl --verify on the initial logs, and it found lot of errors - whether or not this fixed the problem I don't know jdd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, May 3, 2016 at 12:31 PM, jdd
Hello
Nothing indicated worked, but I found sort of a fix.
First, the loga are in /var/log/journal. I use to move parts I want to "remove" with a backup :-).
When I move this folder, it's *not* recreated at boot. I guess the "Storage" option in /etc/systemd/journald.conf is auto. Changing it to "persistent" makes the journal to be read again.
journald.conf auto means use /var/log/journal/<machineid>/ if /var/log/journal/ already exists. If not, then use /run/log/journal/<machineid> where machineid is found from hostnamectl as well as the current boot ID. You don't need to create the machine ID directory, systemd-journald does that. There's some scant evidence that the compression option exacerbates these corruptions or at least the manifestation of them.
journalctl -b 0
is probably stored in ram (/var/run ?) and with the default setup, there is nothing kept after a reboot is /var/log/journal is removed.
I keep it like this now.
But to experiment I runned a
journalctl --verify on the initial logs, and it found lot of errors - whether or not this fixed the problem I don't know
It doesn't fix them. Again what's supposed to happen is the corrupt entry is ignored and everything else can still be read. The problem is the corrupt entry causes journalctl confusion. -- Chris Murphy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 03/05/2016 20:53, Chris Murphy a écrit :
journald.conf auto means use /var/log/journal/<machineid>/ if /var/log/journal/ already exists. If not, then use /run/log/journal/<machineid> where machineid is found from hostnamectl as well as the current boot ID. You don't need to create the machine ID directory, systemd-journald does that.
yes, but /run is in ram jdd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, May 3, 2016 at 3:22 PM, jdd
Le 03/05/2016 20:53, Chris Murphy a écrit :
journald.conf auto means use /var/log/journal/<machineid>/ if /var/log/journal/ already exists. If not, then use /run/log/journal/<machineid> where machineid is found from hostnamectl as well as the current boot ID. You don't need to create the machine ID directory, systemd-journald does that.
yes, but /run is in ram
Yes. Auto means the same thing as the volatile setting if /var/log/journal does not exist. If it does exist, auto means the same thing as the persistent setting. The none setting is meaningless and basically breaks everything so it shouldn't be used. -- Chris Murphy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
04.05.2016 01:07, Chris Murphy пишет:
Yes. Auto means the same thing as the volatile setting if /var/log/journal does not exist. If it does exist, auto means the same thing as the persistent setting. The none setting is meaningless and basically breaks everything so it shouldn't be used.
With "none" you still can use log forwarding to syslog (or may be to terminal or file, although this is likely less useful), so you get as close to common request "systemd with syslog without journal" as it can be done with additional bonus of units output in syslog You lose early logs before syslog is started; but that has always been the case anyway. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 05/03/2016 03:53 AM, jdd wrote:
Hello,
I have a crash problem with a particular application, so I wanted to look at the kernel logs.
then I noticed journalctl do not works as expected.
LANG=US ; journalctl
Quite incidentally ... That does not do what you think. The semicolon means those are two separate commands, as if they had been entered on two separate lines. It does NOT set the language for 'journalctl' Perhaps you meant LANG=US journalctl or possibly export LANG=US ; journalctl -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 03/05/2016 19:26, Anton Aylward a écrit :
On 05/03/2016 03:53 AM, jdd wrote:
LANG=US ; journalctl
Quite incidentally ...
That does not do what you think.
may be I'm lucky, but it works: #journalctl -b 0 mai 03 09:07:35 linux-us26 kern # LANG=US ; journalctl -b 0 May 03 09:07:35 linux-us26 kernel: found SMP MP-ta the LANG stay for the duration of the xterm by the way, to go back to fr in the same xterm, I have to key LANG=fr_FR.UTF8 (full lang), FR don't works with journalctl export seems to be emplied thanks jdd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 05/03/2016 02:00 PM, jdd wrote:
export seems to be emplied
Yes, it is most likely you have you bash configured to do that. It makes things like this convenient. I don't. If I LANG=fr_FR.UTF8 ; journalctl I get English :-) If I LANG=fr_FR.UTF8 journalctl I get French :-) Different settings, obviously :-) -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Anton Aylward wrote:
On 05/03/2016 02:00 PM, jdd wrote:
export seems to be emplied
Yes, it is most likely you have you bash configured to do that. It makes things like this convenient.
I don't.
If I LANG=fr_FR.UTF8 ; journalctl I get English :-)
If I LANG=fr_FR.UTF8 journalctl I get French :-)
Ditto. I wasn't aware bash had such a setting. -- Per Jessen, Zürich (8.6°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
03.05.2016 23:58, Per Jessen пишет:
Anton Aylward wrote:
On 05/03/2016 02:00 PM, jdd wrote:
export seems to be emplied
Yes, it is most likely you have you bash configured to do that. It makes things like this convenient.
I don't.
If I LANG=fr_FR.UTF8 ; journalctl I get English :-)
If I LANG=fr_FR.UTF8 journalctl I get French :-)
Ditto. I wasn't aware bash had such a setting.
What 'env | grep LANG' says? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov wrote:
03.05.2016 23:58, Per Jessen пишет:
Anton Aylward wrote:
On 05/03/2016 02:00 PM, jdd wrote:
export seems to be emplied
Yes, it is most likely you have you bash configured to do that. It makes things like this convenient.
I don't.
If I LANG=fr_FR.UTF8 ; journalctl I get English :-)
If I LANG=fr_FR.UTF8 journalctl I get French :-)
Ditto. I wasn't aware bash had such a setting.
What 'env | grep LANG' says?
env | grep LANG LANG=en_GB.UTF-8 Umm, I didn't test it last night, I was going from memory. In fact, with or without ';', I get French in the two examples above. Interesting. -- Per Jessen, Zürich (6.4°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, May 4, 2016 at 8:33 AM, Per Jessen
Andrei Borzenkov wrote:
03.05.2016 23:58, Per Jessen пишет:
Anton Aylward wrote:
On 05/03/2016 02:00 PM, jdd wrote:
export seems to be emplied
Yes, it is most likely you have you bash configured to do that. It makes things like this convenient.
I don't.
If I LANG=fr_FR.UTF8 ; journalctl I get English :-)
If I LANG=fr_FR.UTF8 journalctl I get French :-)
Ditto. I wasn't aware bash had such a setting.
What 'env | grep LANG' says?
env | grep LANG LANG=en_GB.UTF-8
Umm, I didn't test it last night, I was going from memory. In fact, with or without ';', I get French in the two examples above. Interesting.
I do not see anything interesting here. If LANG is marked for export, then any new value will be exported. This is how Bourne shell behaved from the day one. Difference between the two forms is, variable assignment as part of simple command does not change variable value in *current* shell. And if variable is not currently marked as export it exports it - but only for currently executed command. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov wrote:
On Wed, May 4, 2016 at 8:33 AM, Per Jessen
wrote: Andrei Borzenkov wrote:
03.05.2016 23:58, Per Jessen пишет:
Anton Aylward wrote:
On 05/03/2016 02:00 PM, jdd wrote:
export seems to be emplied
Yes, it is most likely you have you bash configured to do that. It makes things like this convenient.
I don't.
If I LANG=fr_FR.UTF8 ; journalctl I get English :-)
If I LANG=fr_FR.UTF8 journalctl I get French :-)
Ditto. I wasn't aware bash had such a setting.
What 'env | grep LANG' says?
env | grep LANG LANG=en_GB.UTF-8
Umm, I didn't test it last night, I was going from memory. In fact, with or without ';', I get French in the two examples above. Interesting.
I do not see anything interesting here. If LANG is marked for export, then any new value will be exported.
"interesting" = "new to me" :-) How is a variable marked for export?
This is how Bourne shell behaved from the day one. Difference between the two forms is, variable assignment as part of simple command does not change variable value in *current* shell.
Right, which is almost always what I want. -- Per Jessen, Zürich (8.1°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, May 4, 2016 at 10:37 AM, Per Jessen
Andrei Borzenkov wrote:
On Wed, May 4, 2016 at 8:33 AM, Per Jessen
wrote: Andrei Borzenkov wrote:
03.05.2016 23:58, Per Jessen пишет:
Anton Aylward wrote:
On 05/03/2016 02:00 PM, jdd wrote: > > export seems to be emplied
Yes, it is most likely you have you bash configured to do that. It makes things like this convenient.
I don't.
If I LANG=fr_FR.UTF8 ; journalctl I get English :-)
If I LANG=fr_FR.UTF8 journalctl I get French :-)
Ditto. I wasn't aware bash had such a setting.
What 'env | grep LANG' says?
env | grep LANG LANG=en_GB.UTF-8
Umm, I didn't test it last night, I was going from memory. In fact, with or without ';', I get French in the two examples above. Interesting.
I do not see anything interesting here. If LANG is marked for export, then any new value will be exported.
"interesting" = "new to me" :-)
How is a variable marked for export?
export FOO marks FOO for export, export -n FOO unmarks it (this is bash extension). You can also use typeset -|+x FOO for ksh compatibility; or "declare" which in this case is synonym to typeset in bash.
This is how Bourne shell behaved from the day one. Difference between the two forms is, variable assignment as part of simple command does not change variable value in *current* shell.
Right, which is almost always what I want.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov wrote:
On Wed, May 4, 2016 at 10:37 AM, Per Jessen
wrote: How is a variable marked for export?
export FOO
marks FOO for export,
Right - I guess I was more wondering if that is done by some profile by default? -- Per Jessen, Zürich (12.8°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, May 4, 2016 at 2:13 PM, Per Jessen
Andrei Borzenkov wrote:
On Wed, May 4, 2016 at 10:37 AM, Per Jessen
wrote: How is a variable marked for export?
export FOO
marks FOO for export,
Right - I guess I was more wondering if that is done by some profile by default?
/etc/profile.d/lang.sh -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 05/04/2016 03:37 AM, Per Jessen wrote:
How is a variable marked for export
as in export LANG=fr_FR.UTF8 There is also the ability to have the shell automatically export *all* variables anyway. RTFM. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 05/03/2016 04:58 PM, Per Jessen wrote:
Ditto. I wasn't aware bash had such a setting.
Its not as simple as it looks; Some commands are executed in the shell, some in a subshell. So, whether or not VAR is exported, if we run VAR=value echo $VAR with or without a semicolon, it doesn't natter since the 'echo' command is a shell built-in. We can't do a meaningful test that way. if we think of the classical command_one ; command_two mode then each is executed in a subshell; BUT NOT IF THE FIRST IS A BUILT IN COMMAND. Setting variables is a built-in. So, when it comes down to it, it seems that I was wrong n my first statement. I'm not believing that LANG=french ; systemctl and LANG=french systemctl end up being parsed & evaluated the same way because the part before the semicolon is not run in a separate subshell and because /etc/profile.d/lang.sh has already marked LANG for export. Which leads me to two matters. 1. I know you can unset a variable, but I don't know can't see in the man page, how you can "unexport". The best I can see is save the value, unset the variable and then recreate it; Script started on Wed 04 May 2016 08:10:14 AM EDT anton@Mainbox:~> export MYVAR=123 anton@Mainbox:~> echo $MYVAR 123 anton@Mainbox:~> sh sh-4.2$ echo $MYVAR 123 sh-4.2$ exit anton@Mainbox:~> TMP_MYVAR=$MYVAR anton@Mainbox:~> echo $TMP_MYVAR 123 anton@Mainbox:~> sh sh-4.2$ echo $TMP_MYVAR sh-4.2$ exit anton@Mainbox:~> unset MYVAR anton@Mainbox:~> sh sh-4.2$ echo $MYVAR sh-4.2$ exit anton@Mainbox:~> MYVAR=$TMP_MYVAR anton@Mainbox:~> echo $MYVAR 123 anton@Mainbox:~> sh sh-4.2$ echo $MYVAR sh-4.2$ exit anton@Mainbox:~> exit Script done on Wed 04 May 2016 08:12:51 AM EDT Of course some variable may be marked so that you can't unset them ... RTFM says ... typeset [-aAfFgilrtux] [-p] [name[=value] ...] ..... -r Make names readonly. These names cannot then be assigned values by subsequent assignment statements or unset. -x Mark names for export to subsequent commands via the environment. 2. I can't see any simple test to see if a variable is exported. The best I can figure is to compare the output of "echo VAR" with that command executed in a subshell. 3. I can't tell if the 'unset' command merely unsets the value or if it removes the variable. All the tests I can think of can't tell the difference between an empty variable and one that doesn't exit. Perhaps my bash-fu is lacking. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Andrei Borzenkov
-
Anton Aylward
-
Chris Murphy
-
jdd
-
Per Jessen