You are not logged in.

#1 2015-02-04 08:49:13

MilanKnizek
Member
Registered: 2005-12-13
Posts: 88

systemd timers: avoid logging "Started ...." and "Finished ...." msgs.

Hello,

is there a way how to tell systemd not to log "Started ..." and "Finished ..." every time the timer is triggered?

The variable:

Environment=SYSTEMD_LOG_LEVEL=

does not seem to work in timer.unit (in timer section) and systemd actually complains about it.

The reason for this is that I do regular readings from an external device every few minutes and would like to avoid filling up the journal (and save the underlying sdcard from unneccessary write commits). On the other hand, I do not want to decrease overall systemd log level (for other timers or events).

Any ideas?

If not, I would probably write some calendar timer loop inside the bash script and let it run as a daemon instead. Systemd timers would be neater, though.


--
Milan Knizek
http://knizek.net

Offline

#2 2015-02-09 19:26:19

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

Re: systemd timers: avoid logging "Started ...." and "Finished ...." msgs.

I don't have the answer to your question, but I had a similar issue about systemd logging. Turned out the only way I could get the events logged that I wanted was through a kernel command line option:

https://bbs.archlinux.org/viewtopic.php … 3#p1454243

So I woulnd't be too surprised if that kind of design implied that you can't do what you want to do either.

Offline

#3 2015-02-09 20:26:31

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

Re: systemd timers: avoid logging "Started ...." and "Finished ...." msgs.

AFAIU, there are two things that get confused here. First is log processing, another is log viewing (or parsing).

Log processing is basically a ruleset that specifies what gets logged and where. This is a canonical approach of all (decent) syslog implementations (that's what syslog-ng.conf is for). Systemd-journald chose a different design, where _everything_ is logged to a _fixed_ location (either persistent or volatile) and a user specifies _what_ she want s to see via appropriate journalctl options. The latter is basically a log parser, similar to what microsoft did with windows even logger.

Currently journald does not support log processing. So, you can't tell it  to not log things (or to log only specific things). Maybe there are some cmdline parameters that allow you to not _see_ the timer output (but it will still be logged).

Personally, I run journald with Storage=none and use syslog-ng ocnfigured to drop all messages from systemd (they are useless anyways).

EDIT: extra/syslog-ng is "broken" by upstream in the sense that it reads data from journald directly. This means that journald must log somewhere (it is insufficient for it to just run), which in my opinion partly defeats the purpose of using syslog-ng in the 1st place. So, if you want no journald storage (even volatile), then use something like

$ systemctl cat syslog-ng.service 
# /etc/systemd/system/syslog-ng.service
[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)
Requires=syslog.socket

[Service]
Type=notify
ExecStart=/usr/bin/syslog-ng -F
ExecReload=/usr/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
Alias=syslog.service

Last edited by Leonid.I (2015-02-09 20:30:51)


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

Offline

#4 2015-04-25 09:39:51

Trevelian
Member
Registered: 2015-04-11
Posts: 2

Re: systemd timers: avoid logging "Started ...." and "Finished ...." msgs.

Same problem here, i try to use journalctl for everything, but i have timers every minutes so my journalctl is flooded :

Apr 25 11:28:21 garage.sucre systemd[1]: Starting replicam.service...
Apr 25 11:28:21 garage.sucre systemd[1]: Starting dnsupdate.service...
Apr 25 11:28:21 garage.sucre systemd[1]: Starting campingmon.service...
Apr 25 11:28:21 garage.sucre systemd[1]: Started campingmon.service.
Apr 25 11:28:21 garage.sucre systemd[1]: Started dnsupdate.service.
Apr 25 11:28:22 garage.sucre systemd[1]: Started replicam.service.
Apr 25 11:29:21 garage.sucre systemd[1]: Starting replicam.service...
Apr 25 11:29:21 garage.sucre systemd[1]: Starting campingmon.service...
Apr 25 11:29:21 garage.sucre systemd[1]: Started campingmon.service.
Apr 25 11:29:22 garage.sucre systemd[1]: Started replicam.service.

Thanks for your help :-)

Edit :

root garage ~ # cat /etc/systemd/system.conf  | grep Log
LogLevel=notice

notice level seems to correct my problem, i hope i dont miss too much important info smile

Last edited by Trevelian (2015-04-25 10:17:44)

Offline

Board footer

Powered by FluxBB