dnscrypt-proxy, ArchLinux and overwritten .service files

Did you update your arch system only to find that your dnscrypt-proxy.service file was over written – again?

Mine was, as were some other folks, so after a google , and a reread of the ArchLinux wiki page for systemd spotted this

/usr/lib/systemd/system/: units provided by installed packages
/etc/systemd/system/: units installed by the system administrator

So any changes to the default .service files should be placed /etc/systemd/system/ and not written to the /usr/lib/systemd/system/ as that will be over written by the application each time it is upgraded.

As I had already corrected the dnscrypt-proxy.service file I could just copy over to the correct location, to do this I

#cp /usr/lib/systemd/system/dnscrypt-proxy.service /etc/systemd/system/

and then to be sure the systemd symlinks were all correct I stopped/disabled/enabled and restarted the dnscrypt-proxy systemd unit

# systemctl stop dnscrypt-proxy.socket
# systemctl disable dnscrypt-proxy.service
Removed symlink /etc/systemd/system/sockets.target.wants/dnscrypt-proxy.socket.
Removed symlink /etc/systemd/system/multi-user.target.wants/dnscrypt-proxy.service.
# systemctl enable dnscrypt-proxy
Created symlink from /etc/systemd/system/multi-user.target.wants/dnscrypt-proxy.service to /etc/systemd/system/dnscrypt-proxy.service.
Created symlink from /etc/systemd/system/sockets.target.wants/dnscrypt-proxy.socket to /usr/lib/systemd/system/dnscrypt-proxy.socket.
# systemctl start dnscrypt-proxy.socket

The difference being is that I now have an editable dnscrypt-proxy file in /etc/systemd/system/ and not a symlink to the defaults in /usr/lib/systemd/system which are over written as part of the upgrade/install process.

Has it worked?, I will post back when it next updates and confirm this works.

EDIT: 8th September 2015 -just updated two other machines without loss of the dnscrypt-prox settings , so yeah this works

Jase

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s