Skip to content

Commit

Permalink
redhat: use %initsystem check that works when chrooted
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
smccroskey committed Apr 28, 2017
1 parent f9e0332 commit 20701ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redhat/frr.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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
#
Expand Down

0 comments on commit 20701ca

Please sign in to comment.