Skip to content

Commit 657480f

Browse files
committed
Call chkconfig only if $(COPY_ONLY) is set to no
Call chkconfig (or create corresponding links) only if $(COPY_ONLY) variable is set to no. The chkconfig command doesn't take into account the $(DESTDIR) variable contents, trying to create links outside the $(DESTDIR) tree, which can be considered as a way to activate sysstat service. Signed-off-by: Sebastien GODARD <[email protected]>
1 parent cf68e6f commit 657480f

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

Makefile.in

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -411,27 +411,31 @@ endif
411411
$(INSTALL_DATA) cron/sysstat-summary.timer $(DESTDIR)$(SYSTEMD_UNIT_DIR); \
412412
elif [ -d $(DESTDIR)$(INIT_DIR) ]; then \
413413
$(INSTALL_BIN) sysstat $(DESTDIR)$(INIT_DIR)/sysstat; \
414-
if [ -x "$(CHKCONFIG)" ]; then \
415-
cd $(DESTDIR)$(INIT_DIR) && $(CHKCONFIG) --add sysstat; \
416-
else \
417-
[ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
418-
[ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
419-
[ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
420-
cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
421-
cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
422-
cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
414+
if [ "$(COPY_ONLY)" == "n" ]; then \
415+
if [ -x "$(CHKCONFIG)" ]; then \
416+
cd $(DESTDIR)$(INIT_DIR) && $(CHKCONFIG) --add sysstat; \
417+
else \
418+
[ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
419+
[ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
420+
[ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
421+
cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
422+
cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
423+
cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../$(INITD_DIR)/sysstat S01sysstat; \
424+
fi \
423425
fi \
424426
elif [ -d $(DESTDIR)$(RC_DIR) ]; then \
425427
$(INSTALL_BIN) sysstat $(DESTDIR)$(RC_DIR)/rc.sysstat; \
426-
if [ -x "$(CHKCONFIG)" ]; then \
427-
cd $(DESTDIR)$(RC_DIR) && $(CHKCONFIG) --add rc.sysstat; \
428-
else \
429-
[ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
430-
[ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
431-
[ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
432-
cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
433-
cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
434-
cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
428+
if [ "$(COPY_ONLY)" == "n" ]; then \
429+
if [ -x "$(CHKCONFIG)" ]; then \
430+
cd $(DESTDIR)$(RC_DIR) && $(CHKCONFIG) --add rc.sysstat; \
431+
else \
432+
[ -d $(DESTDIR)$(RC2_DIR) ] || mkdir -p $(DESTDIR)$(RC2_DIR); \
433+
[ -d $(DESTDIR)$(RC3_DIR) ] || mkdir -p $(DESTDIR)$(RC3_DIR); \
434+
[ -d $(DESTDIR)$(RC5_DIR) ] || mkdir -p $(DESTDIR)$(RC5_DIR); \
435+
cd $(DESTDIR)$(RC2_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
436+
cd $(DESTDIR)$(RC3_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
437+
cd $(DESTDIR)$(RC5_DIR) && $(LN_S) -f ../rc.sysstat S01sysstat; \
438+
fi \
435439
fi \
436440
fi
437441
ifeq ($(COPY_ONLY),n)

0 commit comments

Comments
 (0)