hoytech / vmtouch

Portable file system cache diagnostics and control
https://hoytech.com/vmtouch/
BSD 3-Clause "New" or "Revised" License
1.79k stars 210 forks source link

Fix sysvinit binary location #76

Closed MichaIng closed 4 years ago

MichaIng commented 4 years ago

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=947603

Signed-off-by: MichaIng micha@dietpi.com

MichaIng commented 4 years ago

Best would be actually to adjust this based on make BINDIR: https://github.com/hoytech/vmtouch/blob/master/Makefile#L2

Not sure if there is some automated solution via Makefile or Debian packages to adjust such files based on environment variables, else it could be done via postinst script?

hoytech commented 4 years ago

Thanks! I don't think we have any way of setting up the DAEMON based on the PREFIX. If somebody would like to add that I'd be happy to merge. :)

MichaIng commented 4 years ago

@hoytech Probably not the most beautiful solution, but the Debian package adds this postinst script, which could do the adjustment as first step:

root@BuildingRPi:~# cat /var/lib/dpkg/info/vmtouch.postinst
#!/bin/sh
set -e
# Automatically added by dh_installinit/10.7.2
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
        if [ -x "/etc/init.d/vmtouch" ]; then
                update-rc.d vmtouch defaults >/dev/null
                if [ -n "$2" ]; then
                        _dh_action=restart
                else
                        _dh_action=start
                fi
                invoke-rc.d vmtouch $_dh_action || exit $?
        fi
fi
# End automatically added section

But I have not much experience with Debian package building, and it seems to be an automated part of the debhelper-compat currently: https://buildd.debian.org/status/fetch.php?pkg=vmtouch&arch=amd64&ver=1.3.1-1&stamp=1563455035&raw=0

Anyway, since make install installs the sysvinit service as well, it makes more sense to have this already as part of the make process. Ah sorry, build install seems to not install the service,, right?