libldm
libldm copied to clipboard
systemd unit
Would you consider adding a simple systemd unit, e.g.:
[Unit]
Description=Activate Windows Logical Disk Manager volumes
Documentation=man:ldmtool(1)
[Service]
ExecStart=/usr/bin/ldmtool create all
ExecStop=/usr/bin/ldmtool remove all
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
This would allow adding LDM mounts to fstab, e.g.:
/dev/mapper/ldm_vol_LOCALHOST-Dg0_Volume1 /mnt/windata ntfs defaults,rw,x-systemd.requires=ldm.service 0 0
I guess so. I tried to use autoconf to substitute the correct @bindir@ but it insists on putting ${exec_prefix} into the path for spurious reasons. Do you have a suggested patch?
No patch, sorry. But if you post your not-exactly-working one, I could take a look and maybe fix it.
Sure, it's completely wrong though: http://oirase.annexia.org/tmp/0001-Add-example-systemd-unit-file.patch.txt
Not sure what you mean by completely wrong, it works just fine for me. The unit file generated by configure has /usr/bin/ldmtool in it.
For me it has:
[Service]
ExecStart=${exec_prefix}/bin/ldmtool create all
ExecStop=${exec_prefix}/bin/ldmtool remove all
Which distro? I was testing on F33.
Even on rawhide, the resulting unit file contains /usr/bin/ldmtool. I did both tests in mock, so I'm not sure why you're seeing different results.
Here's my patch for Fedora package that I used for testing: 0001-New-upstream-version-0.2.5.patch.txt
It still has ${exec_prefix} for me (when compiling from source). This is a well-known misfeature of autoconf: https://stackoverflow.com/questions/54405359/how-to-recursively-substitute-variable-for-a-path-in-bash-variable-in-configure
I wonder if either make install or RPM are fixing it?
So it's make install. I'll add my patch since it should be ok after all.
I pushed this: https://github.com/mdbooth/libldm/commit/5014da5b90713123157b2604ac566514682e7f37
The Makefile.am probably needs adjusting further to install this file in some place, although maybe we don't want to install this for everyone, just "suggest" it.
So it's make install. I'll add my patch since it should be ok after all.
Interesting. I haven't actually checked the contents between %build and %install, so I haven't seen this.
I pushed this: 5014da5
Thanks!
The Makefile.am probably needs adjusting further to install this file in some place, although maybe we don't want to install this for everyone, just "suggest" it.
I think it's fine to leave it in the source tree and let distros consume it at will for now.
It might be even better to change WantedBy= from multi-user.target to local-fs-pre.target. This way the filesystems can be used in /etc/fstab even without specifying x-systemd.requires=ldm.service. If changed make sure to also add Before=local-fs-pre.target, so local-fs-pre.target isn't considered active until ldm.service is.
They're currently doing it this way on Arch Linux: https://github.com/archlinux/svntogit-community/blob/a7db3683d17aca7891a69110d9e6e2af9cea0544/trunk/ldmtool.service