-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from thedoc31/1.8
Add Amazon Linux support
- Loading branch information
Showing
2 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
$ModLoad imudp | ||
$UDPServerAddress 127.0.0.1 | ||
$UDPServerRun 514 | ||
|
||
$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n" | ||
$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n" | ||
|
||
local2.=info /var/log/haproxy/access.log;HAProxy | ||
local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI | ||
local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI | ||
local2.* ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ Group: System Environment/Daemons | |
URL: http://www.haproxy.org/ | ||
Source0: http://www.haproxy.org/download/1.8/src/%{name}-%{version}.tar.gz | ||
Source1: %{name}.cfg | ||
%{?amzn1:Source2: %{name}.init} | ||
%{?el6:Source2: %{name}.init} | ||
%{?el7:Source2: %{name}.service} | ||
Source3: %{name}.logrotate | ||
|
@@ -29,7 +30,7 @@ BuildRequires: pcre-devel make gcc openssl-devel | |
|
||
Requires(pre): shadow-utils | ||
|
||
%if 0%{?el6} | ||
%if 0%{?el6} || 0%{?amzn1} | ||
Requires(post): chkconfig, initscripts | ||
Requires(preun): chkconfig, initscripts | ||
Requires(postun): initscripts | ||
|
@@ -80,7 +81,7 @@ systemd_opts= | |
|
||
%install | ||
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} | ||
|
||
%{__install} -d %{buildroot}%{_sbindir} | ||
%{__install} -d %{buildroot}%{_sysconfdir}/logrotate.d | ||
%{__install} -d %{buildroot}%{_sysconfdir}/rsyslog.d | ||
|
@@ -90,10 +91,10 @@ systemd_opts= | |
%{__install} -d %{buildroot}%{_mandir}/man1/ | ||
|
||
%{__install} -s %{name} %{buildroot}%{_sbindir}/ | ||
%if 0%{?el6} | ||
%if 0%{?el6} || 0%{?amzn1} | ||
%{__install} -d %{buildroot}%{_sysconfdir}/rc.d/init.d | ||
%{__install} -c -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name} | ||
%endif | ||
%endif | ||
%if 0%{?el7} | ||
%{__install} -s %{name} %{buildroot}%{_sbindir}/ | ||
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service | ||
|
@@ -114,14 +115,14 @@ getent passwd %{haproxy_user} >/dev/null || \ | |
useradd -u 188 -r -g %{haproxy_group} -d %{haproxy_home} \ | ||
-s /sbin/nologin -c "%{name}" %{haproxy_user} | ||
exit 0 | ||
|
||
%post | ||
%if 0%{?el7} | ||
%systemd_post %{name}.service | ||
systemctl restart rsyslog.service | ||
%endif | ||
|
||
%if 0%{?el6} | ||
%if 0%{?el6} || 0%{?amzn1} | ||
/sbin/chkconfig --add %{name} | ||
/sbin/service rsyslog restart >/dev/null 2>&1 || : | ||
%endif | ||
|
@@ -131,7 +132,7 @@ systemctl restart rsyslog.service | |
%systemd_preun %{name}.service | ||
%endif | ||
|
||
%if 0%{?el6} | ||
%if 0%{?el6} || 0%{?amzn1} | ||
if [ $1 = 0 ]; then | ||
/sbin/service %{name} stop >/dev/null 2>&1 || : | ||
/sbin/chkconfig --del %{name} | ||
|
@@ -144,7 +145,7 @@ fi | |
systemctl restart rsyslog.service | ||
%endif | ||
|
||
%if 0%{?el6} | ||
%if 0%{?el6} || 0%{?amzn1} | ||
if [ "$1" -ge "1" ]; then | ||
/sbin/service %{name} condrestart >/dev/null 2>&1 || : | ||
/sbin/service rsyslog restart >/dev/null 2>&1 || : | ||
|
@@ -158,9 +159,12 @@ fi | |
%dir %{_localstatedir}/log/%{name} | ||
|
||
%attr(0755,root,root) %{_sbindir}/%{name} | ||
%if 0%{?amzn1} | ||
%attr(0755,root,root) %config %_sysconfdir/rc.d/init.d/%{name} | ||
%endif | ||
%if 0%{?el6} | ||
%attr(0755,root,root) %config %_sysconfdir/rc.d/init.d/%{name} | ||
%endif | ||
%endif | ||
%if 0%{?el7} | ||
%attr(0755,root,root) %{_sbindir}/%{name} | ||
%attr(-,root,root) %{_unitdir}/%{name}.service | ||
|
@@ -172,6 +176,9 @@ fi | |
%attr(0644,root,root) %config %{_sysconfdir}/rsyslog.d/49-%{name}.conf | ||
|
||
%changelog | ||
* Fri Feb 23 2018 J. Casalino <[email protected]> | ||
- Add support for Amazon Linux (Fedora-based) | ||
|
||
* Mon Jul 31 2017 David Bezemer <[email protected]> | ||
- Update for HAproxy 1.7.8 | ||
|
||
|