I have a Debian stretch where I'm running
transmission-daemon as a service.
I keep my seeded files on an external USB hard disk drive mounted on
/mnt/external-disk. This disk has an
ext4 filesystem, and I mapped it in
/etc/fstab by uuid.
The problem is:
When the service
transmission-daemon starts at boot it doesn't check if the external filesystem is already mounted so it doesn't find the files on it, and I get a data error and the torrent files are not seeded, but the service starts.
To resolve this problem I checked the
systemd documentation, and I found what was missing:
RequiresMountsFor= in the
[Unit] section of the
transmission-daemon.service file is located in the tree below
After I added that line with the path of the mountpoint
/mnt/external-disk the problem disappeared and the service was working fine.
If I rebooted the machine, the service was working, and the files were seeded.
This worked until I had a
apt-get dist-upgrade where the package
transmission-daemon was involved and after it stopped.
So I checked the
transmission-daemon.service, and I found the modification I made was missing.
I added the line
RequiresMountsFor= another time with the proper path, and the problem was fixed again.
My question is: How can I make this modification persistent?