Jump to content

Systemd tips and tricks


Recommended Posts

abarbarian

Whilst there are some threads concerning systemd there does not seem to be a thread about using systemd that I can find so this is just such a thread.

This is a thread to post useful information on the general usage of systemd for whatever os.

 

My tip is a little outside my knowledge zone but I can see that it looks very useful. :look:

 

http://jjacky.com/2013-10-06-run-triggers-on-systemd-journal-messages/

 

Installed as a service, it runs in the background and whenever a matching messages is added to the journal, the corresponding action is triggered. Exactly what I was looking for.

For example, an error can sometimes occur leading to the network being down, as the interface goes down with a speed/duplex mismatch error. This doesn't happen very often and is easy enough to fix once the problem has been identified, but now I don't have to, thanks to a simple rule like the following:

[Rule]

trigger=systemctl restart network.service

[Filter]

_KERNEL_DEVICE=+pci:0000:02:00.0

MESSAGE=sky2 0000:02:00.0 net0: speed/duplex mismatch

See I told you it was a useful tip.

:breakfast:

  • Like 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...