On 06/19/2014 07:43 AM, ssdxiao wrote:
need rpm support to install the SysV init scripts
Signed-off-by: Ding Xiao <ssdxiao(a)163.com>
---
contrib/Makefile.am | 1 +
contrib/kimchi.spec.fedora.in | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index e36d4cd..8f205ba 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -18,6 +18,7 @@ SUBDIRS = DEBIAN
EXTRA_DIST = \
kimchid.sysvinit \
+ kimchid.sysvinit.centos6 \
kimchid.service.fedora \
kimchi.spec.fedora.in \
kimchid-upstart.conf.debian \
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 7a7d5e0..c583d30 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -77,6 +77,7 @@ install -Dm 0640 src/firewalld.xml
%{buildroot}%{_prefix}/lib/firewalld/services
%if 0%{?rhel} == 6
# Install the upstart script
install -Dm 0755 contrib/kimchid-upstart.conf.fedora
%{buildroot}/etc/init/kimchid.conf
+install -Dm 0755 contrib/kimchid.sysvinit.centos6 %{buildroot}%{_initrddir}/kimchid
%endif
So 2 startup scripts will be installed in the system when it is rhel 6?
Instead of doing that, we should be able to recognize when system uses
upstart or not
And based on that install the right startup script
%if 0%{?rhel} == 5
# Install the SysV init scripts
@@ -196,6 +197,7 @@ rm -rf $RPM_BUILD_ROOT
%endif
%if 0%{?rhel} == 6
/etc/init/kimchid.conf
+%{_initrddir}/kimchid
%endif
%if 0%{?rhel} == 5
%{_initrddir}/kimchid