]> git.proxmox.com Git - mirror_frr.git/commitdiff
redhat: use %initsystem check that works when chrooted
authorsmccroskey <smccroskey@cumulusnetworks.com>
Fri, 28 Apr 2017 02:39:24 +0000 (19:39 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 6 Jun 2017 18:40:34 +0000 (14:40 -0400)
`systemctl' returns different, non-useful output while in a chroot.
Switch to checking if /sbin/init is a symlink to the systemd binary.
With this change the build works in a mock chroot.

Signed-off-by: Silas McCroskey <smccroskey@cumulusnetworks.com>
redhat/frr.spec.in

index 523af5da2090bb123e9297eff9eeebd96854da6c..9b2e188a3af3e33aaeeb575a7e78d525c66c682a 100644 (file)
@@ -50,7 +50,7 @@
 
 #### Check for systemd or init.d (upstart)
 # Check for init.d (upstart) as used in CentOS 6 or systemd (ie CentOS 7)
-%{expand: %%global initsystem %(if [[ `/sbin/init --version 2> /dev/null` =~ upstart ]]; then echo upstart; elif [[ `systemctl` =~ -\.mount ]]; then echo systemd; fi)}
+%{expand: %%global initsystem %(if [[ `/sbin/init --version 2> /dev/null` =~ upstart ]]; then echo upstart; elif [[ `file /sbin/init` =~ "symbolic link to \`../lib/systemd/systemd'" ]]; then echo systemd; fi)}
 #
 # If init system is systemd, then always disable watchfrr
 #