You are not logged in.

#1 2015-08-16 16:25:02

seqizz
Member
Registered: 2011-04-04
Posts: 37

[SOLVED] (systemd) Restart a service when connectivity changes

Hi everyone,

Just set up my laptop with Arch, seems like only thing left to be perfect is dns resolution.

I'm using dnscrypt-proxy with systemd. I can connect/disconnect often via different interfaces (between wlan and ethernet, using NetworkManager).

I guess there is  a routing problem or something, when I change connected interface I can't get answers for my DNS queries from  53. port (dnscrypt) until I restart the service.

Is there a known solution, or a way to restart the service whenever a change occurs in connection state?

Thanks!

Last edited by seqizz (2015-08-16 17:32:56)


Creeds matter very little… The optimist proclaims that we live in the best of all possible worlds; and the pessimist fears this is true. So I elect for neither label. - James Branch Cabell

Offline

#2 2015-08-16 17:14:41

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] (systemd) Restart a service when connectivity changes

You can use a dispatcher script to restart the service.

$ man NetworkManager

Offline

#3 2015-08-16 17:33:57

seqizz
Member
Registered: 2011-04-04
Posts: 37

Re: [SOLVED] (systemd) Restart a service when connectivity changes

Oh, thanks. Totally forgot about that feature. Just created 2-line script inside dispatcher.d and enabled the service.


Creeds matter very little… The optimist proclaims that we live in the best of all possible worlds; and the pessimist fears this is true. So I elect for neither label. - James Branch Cabell

Offline

Board footer

Powered by FluxBB