You are not logged in.
I have a simple timer/service file combination to run a ganglia script.
Timer file:
[Unit]
Description=Run ganglia gmetric for nfs
[Timer]
OnBootSec=5min
OnUnitActiveSec=20s
Unit=gmetric-nfs3.service
[Install]
WantedBy=multi-user.target
Service file:
[Unit]
Description=Run ganglia gmetric for nfs
[Service]
Type=simple
ExecStart=/usr/bin/nfs_stats.pl
This works fine, but my journalctl is now full of the following messages:
Aug 11 17:49:30 fraser-server systemd[1]: Started Run ganglia gmetric for nfs.
Aug 11 17:48:50 fraser-server systemd[1]: Starting Run ganglia gmetric for nfs...
Aug 11 17:48:50 fraser-server systemd[1]: Started Run ganglia gmetric for nfs.
Aug 11 17:48:10 fraser-server systemd[1]: Starting Run ganglia gmetric for nfs...
Aug 11 17:48:10 fraser-server systemd[1]: Started Run ganglia gmetric for nfs.
Aug 11 17:47:30 fraser-server systemd[1]: Starting Run ganglia gmetric for nfs...
Aug 11 17:47:30 fraser-server systemd[1]: Started Run ganglia gmetric for nfs.
Aug 11 17:46:50 fraser-server systemd[1]: Starting Run ganglia gmetric for nfs...
Aug 11 17:46:50 fraser-server systemd[1]: Started Run ganglia gmetric for nfs.
Aug 11 17:46:19 fraser-server systemd[1]: Starting Run ganglia gmetric for nfs...
Aug 11 17:46:19 fraser-server systemd[1]: Started Run ganglia gmetric for nfs.
Aug 11 17:45:57 fraser-server systemd[1]: Starting Run ganglia gmetric for nfs...
Aug 11 17:45:57 fraser-server systemd[1]: Started Run ganglia gmetric for nfs.
That makes sense, but those messages are useless and they clutter the log. Is there any way to suppress them?
Home Page: www.michaeldacre.com
Lab: Hunter Fraser's Lab
GPG key: E76370D6
Offline
Does anyone know how to do this? Otherwise I will just have to switch back to crontab.
Should I try posting to another forum?
Home Page: www.michaeldacre.com
Lab: Hunter Fraser's Lab
GPG key: E76370D6
Offline
Does anyone know how to do this? Otherwise I will just have to switch back to crontab.
Should I try posting to another forum?
The issue is not whether you use timers or cron, but journald. One of its design goals is to log _everything_ in one place. You don't get to choose what is logged, only what to see. So, you won't get noise from timers, but get it from crond.
Just using journalctl (w/o arguments) is a wrong thing to do because it will show lots of stuff. A proper way to use journald is to _know_ (journalctl -u ...) what you are looking for, similar to Windows eventlog.
Of course, regardless of how you use journald, you'll have to pay a performance penalty. For instance, on my machine it takes ~30 sec to get an output of journalctl -u smartd.service (and this is 12-core opteron with all journal files in /run/log) just because the box is also a firewall, so iptables log a lot. If that's a problem for you, use syslog-ng/rsyslog.
Hence, the answer to your question is "you can't".
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
Great, thanks Leonid.
That makes sense and I appreciate the philosophy, but I am still a little archaic in my approach to logs. When something goes wrong on the server, I still like being able to do journalctl --since=10:00 --until=13:00 and just look at everything. I do use grep, the unit flag, and even SYSLOG_FACILITY when I am looking more carefully. But for me just looking at everything is nice. So for now I switched that process to being a cron timer instead of a systemd timer.
Thanks for your answer though, I feel like I understand systemd a little better.
Home Page: www.michaeldacre.com
Lab: Hunter Fraser's Lab
GPG key: E76370D6
Offline