You are not logged in.

#1 2016-10-20 19:20:23

DonOregano
Member
From: Uppsala, Sweden
Registered: 2013-07-13
Posts: 6

Writing a --- MARK --- in journal periodically

I'm trying to work out why and when a server of mine crashes (could be power failure or a hardware problem or god knows, but we don't need to go into that), and I've been longing for the olden days where I got --- MARK --- written to my logs every now and then.

I've googled my fingers off, but have not been able to find any way of enabling that sort of thing in journald. So I wrote my own timer that does that, but of course I get the following output (three lines instead of just the one, which is a bit excessive):

Oct 20 21:10:12 liet systemd[1]: Started Write a mark in journal.
Oct 20 21:10:12 liet root[546]: --- MARK ---
Oct 20 21:10:12 liet systemd[1]: Starting Write a mark in journal...

Any suggestions?

Offline

#2 2016-10-20 20:29:27

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Writing a --- MARK --- in journal periodically

I have not tested it but wouldn't an endless loop with a sleep and an echo (or whichever way you have implemented it now) do the same when started as a service?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2016-10-20 20:31:28

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: Writing a --- MARK --- in journal periodically

R00KIE wrote:

....and an echo (or whichever way you have implemented it now) ...


logger would be my tool of choice here.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2016-10-21 11:49:24

DonOregano
Member
From: Uppsala, Sweden
Registered: 2013-07-13
Posts: 6

Re: Writing a --- MARK --- in journal periodically

Yes, of course. I was just hoping for something more elegant than adding a new process to my system. I would have thought other people had wanted this before me :-)

But it seems I'll be writing a while loop tonight :-)

Thanks

Offline

#5 2016-10-21 18:25:10

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Writing a --- MARK --- in journal periodically

The "-- MARK --" entries were generated by syslog-ng. And this feature is still present, controlled by mark_freq() in syslog-ng.conf...


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#6 2016-10-21 18:54:29

DonOregano
Member
From: Uppsala, Sweden
Registered: 2013-07-13
Posts: 6

Re: Writing a --- MARK --- in journal periodically

Yeah, I liked them. I was hoping to get told that there was some journald option I'd overlooked, and that it was easy to enable :-)

Offline

Board footer

Powered by FluxBB