--- trunk/include/mtools.sminc 2012/01/14 01:48:34 9880 +++ trunk/include/mtools.sminc 2012/02/05 14:10:16 10935 @@ -769,9 +769,14 @@ { local unit local file + local prefix [[ -z "$1" ]] && die "No unit given" + # get the right prefix for newer systemd + [[ -x /bin/systemctl ]] && prefix="" + [[ -x /usr/bin/systemctl ]] && prefix="/usr" + # if no fullpath given use file from sourcedir if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]] then @@ -788,10 +793,10 @@ fi # needed directory - install -d ${BINDIR}/lib/systemd/system || die + install -d ${BINDIR}${prefix}/lib/systemd/system || die # install our initscript - install -v -m 0644 -o root -g root ${file} ${BINDIR}/lib/systemd/system/${unit} || die + install -v -m 0644 -o root -g root ${file} ${BINDIR}${prefix}/lib/systemd/system/${unit} || die } # installs systemd tmp configs to /etc/tmpfiles.d