From e9562ab488856a7f4ef588d71af148fe5550c252 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Tue, 22 Oct 2019 19:25:51 +0100 Subject: [PATCH] config/functions: ensure enable_service tells us why it failed --- config/functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/functions b/config/functions index 98866b1872..a95e0dfa28 100644 --- a/config/functions +++ b/config/functions @@ -1298,11 +1298,12 @@ add_group() { # Usage: enable_service [target] enable_service() { local unit="$1" - local unit_dir="/usr/lib/systemd/system" + local unit_dir="usr/lib/systemd/system" local target="$2" local target_dir=$INSTALL - [ -f "$target_dir/$unit_dir/$unit" ] || die + [ -f "$target_dir/$unit_dir/$unit" ] || die "ERROR: cannot enable non-existent service $target_dir/$unit_dir/$unit" + if [ -z "$target" ] ; then for target in `grep '^WantedBy' $target_dir/$unit_dir/$unit | cut -f2 -d=` ; do if [ -n "$target" ]; then