mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-11 20:26:36 +00:00
redhat: Add frr.service file for redhat based systemd systems (using init script)
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
parent
178b92ceb1
commit
2cdd3d94fc
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
EXTRA_DIST = frr.init daemons \
|
EXTRA_DIST = frr.init frr.service daemons \
|
||||||
frr.logrotate frr.pam frr.spec \
|
frr.logrotate frr.pam frr.spec \
|
||||||
README.rpm_build.md
|
README.rpm_build.md
|
||||||
|
|
||||||
|
23
redhat/frr.service
Normal file
23
redhat/frr.service
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=FRRouting (FRR)
|
||||||
|
After=syslog.target networking.service
|
||||||
|
OnFailure=heartbeat-failed@%n.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Nice=-5
|
||||||
|
Type=forking
|
||||||
|
NotifyAccess=all
|
||||||
|
StartLimitInterval=3m
|
||||||
|
StartLimitBurst=3
|
||||||
|
TimeoutSec=1m
|
||||||
|
WatchdogSec=60s
|
||||||
|
RestartSec=5
|
||||||
|
Restart=on-abnormal
|
||||||
|
LimitNOFILE=1024
|
||||||
|
ExecStart=/usr/lib/frr/frr start
|
||||||
|
ExecStop=/usr/lib/frr/frr stop
|
||||||
|
ExecReload=/usr/lib/frr/frr reload
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=network-online.target
|
||||||
|
|
@ -294,12 +294,16 @@ make DESTDIR=%{buildroot} INSTALL="install -p" CP="cp -p" install
|
|||||||
# Remove this file, as it is uninstalled and causes errors when building on RH9
|
# Remove this file, as it is uninstalled and causes errors when building on RH9
|
||||||
rm -rf %{buildroot}/usr/share/info/dir
|
rm -rf %{buildroot}/usr/share/info/dir
|
||||||
|
|
||||||
|
# Remove debian init script if it was installed
|
||||||
|
rm -f %{buildroot}%{_sbindir}/frr
|
||||||
|
|
||||||
# install /etc sources
|
# install /etc sources
|
||||||
%if "%{initsystem}" == "systemd"
|
%if "%{initsystem}" == "systemd"
|
||||||
mkdir -p %{buildroot}%{_unitdir}
|
mkdir -p %{buildroot}%{_unitdir}
|
||||||
install %{frr_tools}/frr.service \
|
install %{zeb_rh_src}/frr.service \
|
||||||
%{buildroot}%{_unitdir}/frr.service
|
%{buildroot}%{_unitdir}/frr.service
|
||||||
|
install %{zeb_rh_src}/frr.init \
|
||||||
|
%{buildroot}%{_sbindir}/frr
|
||||||
%else
|
%else
|
||||||
mkdir -p %{buildroot}/etc/rc.d/init.d
|
mkdir -p %{buildroot}/etc/rc.d/init.d
|
||||||
install %{zeb_rh_src}/frr.init \
|
install %{zeb_rh_src}/frr.init \
|
||||||
@ -384,7 +388,7 @@ if [ ! -e %{_sysconfdir}/zebra.conf ]; then
|
|||||||
%if 0%{?frr_user:1}
|
%if 0%{?frr_user:1}
|
||||||
chown %frr_user:%frr_user %{_sysconfdir}/zebra.conf*
|
chown %frr_user:%frr_user %{_sysconfdir}/zebra.conf*
|
||||||
%endif
|
%endif
|
||||||
chmod 640 %{_sysconfdir}/zebra.conf
|
chmod 640 %{_sysconfdir}/zebra.conf*
|
||||||
fi
|
fi
|
||||||
for daemon in %{all_daemons} ; do
|
for daemon in %{all_daemons} ; do
|
||||||
if [ x"${daemon}" != x"" ] ; then
|
if [ x"${daemon}" != x"" ] ; then
|
||||||
@ -396,6 +400,10 @@ for daemon in %{all_daemons} ; do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
%if 0%{?frr_user:1}
|
||||||
|
chown %frr_user:%frr_user %{_sysconfdir}/daemons
|
||||||
|
%endif
|
||||||
|
|
||||||
%if %{with_watchfrr}
|
%if %{with_watchfrr}
|
||||||
# No config for watchfrr - this is part of /etc/sysconfig/frr
|
# No config for watchfrr - this is part of /etc/sysconfig/frr
|
||||||
rm -f %{_sysconfdir}/watchfrr.*
|
rm -f %{_sysconfdir}/watchfrr.*
|
||||||
@ -404,8 +412,10 @@ done
|
|||||||
if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
|
if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
|
||||||
touch %{_sysconfdir}/vtysh.conf
|
touch %{_sysconfdir}/vtysh.conf
|
||||||
chmod 640 %{_sysconfdir}/vtysh.conf
|
chmod 640 %{_sysconfdir}/vtysh.conf
|
||||||
|
%if 0%{?frr_user:1}
|
||||||
%if 0%{?vty_group:1}
|
%if 0%{?vty_group:1}
|
||||||
chown frr:%{vty_group} %{_sysconfdir}/vtysh.conf*
|
chown %{frr_user}:%{vty_group} %{_sysconfdir}/vtysh.conf*
|
||||||
|
%endif
|
||||||
%endif
|
%endif
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -545,8 +555,7 @@ rm -rf %{buildroot}
|
|||||||
%{_sbindir}/ospfd
|
%{_sbindir}/ospfd
|
||||||
%{_sbindir}/ripd
|
%{_sbindir}/ripd
|
||||||
%{_sbindir}/bgpd
|
%{_sbindir}/bgpd
|
||||||
%{_sbindir}/ssd
|
%exclude %{_sbindir}/ssd
|
||||||
%{_sbindir}/frr
|
|
||||||
%if %{with_watchfrr}
|
%if %{with_watchfrr}
|
||||||
%{_sbindir}/watchfrr
|
%{_sbindir}/watchfrr
|
||||||
%endif
|
%endif
|
||||||
@ -565,13 +574,14 @@ rm -rf %{buildroot}
|
|||||||
%attr(755,root,root) %{_libdir}/lib*.so.0.*
|
%attr(755,root,root) %{_libdir}/lib*.so.0.*
|
||||||
%endif
|
%endif
|
||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
%config /etc/frr/[!v]*
|
%config(noreplace) /etc/frr/[!v]*
|
||||||
|
%attr(750,%frr_user,%frr_user) /etc/frr/daemons
|
||||||
%if "%{initsystem}" == "systemd"
|
%if "%{initsystem}" == "systemd"
|
||||||
%config %{_unitdir}/frr.service
|
%config %{_unitdir}/frr.service
|
||||||
|
%{_sbindir}/frr
|
||||||
%else
|
%else
|
||||||
%config /etc/rc.d/init.d/frr
|
%config /etc/rc.d/init.d/frr
|
||||||
%endif
|
%endif
|
||||||
%config(noreplace) /etc/frr/daemons
|
|
||||||
%config(noreplace) /etc/pam.d/frr
|
%config(noreplace) /etc/pam.d/frr
|
||||||
%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
|
%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
|
||||||
|
|
||||||
@ -602,9 +612,11 @@ rm -rf %{buildroot}
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Apr 13 2017 Martin Winter <mwinter@opensourcerouting.org> - %{version}
|
* Thu Apr 17 2017 Martin Winter <mwinter@opensourcerouting.org> - %{version}
|
||||||
- new subpackage frr-pythontools with python 2.7 restart script
|
- new subpackage frr-pythontools with python 2.7 restart script
|
||||||
- remove PIMd from CentOS/RedHat 6 RPM packages (won't work - too old)
|
- remove PIMd from CentOS/RedHat 6 RPM packages (won't work - too old)
|
||||||
|
- converted to single frr init script (not per daemon) based on debian init script
|
||||||
|
- created systemd service file for systemd based systems (which uses init script)
|
||||||
- Various other RPM package fixes for FRR 2.0
|
- Various other RPM package fixes for FRR 2.0
|
||||||
|
|
||||||
* Fri Jan 6 2017 Martin Winter <mwinter@opensourcerouting.org>
|
* Fri Jan 6 2017 Martin Winter <mwinter@opensourcerouting.org>
|
||||||
|
Loading…
Reference in New Issue
Block a user