aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Macku <jamacku@redhat.com>2021-04-07 16:42:24 +0200
committerJan Macku <jamacku@redhat.com>2021-05-31 16:03:53 +0200
commited2056c28bb76d9a0e7c201e210d2767ab7f164a (patch)
treebd4e36bfe1c9d71e6fbe8c4c9462b333a85a2cbe
parent162d35c5fd2ab082efb65c5cfc8206b8bab5f52f (diff)
downloadinitscripts-ed2056c28bb76d9a0e7c201e210d2767ab7f164a.tar
initscripts-ed2056c28bb76d9a0e7c201e210d2767ab7f164a.tar.gz
initscripts-ed2056c28bb76d9a0e7c201e210d2767ab7f164a.tar.bz2
initscripts-ed2056c28bb76d9a0e7c201e210d2767ab7f164a.tar.xz
initscripts-ed2056c28bb76d9a0e7c201e210d2767ab7f164a.zip
spec: Move service script into subpackage
This changes moves service script into initscripts-service subpackage. The subpackage could be install without main package. This change allows audit not to require initscripts and require only initscripts-service instead. Requested by: msekleta@redhat.com
-rw-r--r--etc/rc.d/init.d/functions1
-rw-r--r--initscripts.spec33
-rwxr-xr-xusr/sbin/service11
3 files changed, 40 insertions, 5 deletions
diff --git a/etc/rc.d/init.d/functions b/etc/rc.d/init.d/functions
index 5ede6c76..e5576196 100644
--- a/etc/rc.d/init.d/functions
+++ b/etc/rc.d/init.d/functions
@@ -605,6 +605,7 @@ strstr() {
}
# Check whether file $1 is a backup or rpm-generated file and should be ignored
+# Copy of the function is present in usr/sbin/service
is_ignored_file() {
case "$1" in
*~ | *.bak | *.old | *.orig | *.rpmnew | *.rpmorig | *.rpmsave)
diff --git a/initscripts.spec b/initscripts.spec
index 8d35e309..749d84c5 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -34,6 +34,7 @@ Requires: procps-ng
Requires: setup
Requires: systemd
Requires: util-linux
+Recommends: initscripts-service
Requires(pre): shadow-utils
Requires(post): coreutils
@@ -51,8 +52,6 @@ BuildRequires: make
%{?systemd_requires}
BuildRequires: systemd
-Provides: /sbin/service
-
Obsoletes: %{name} < 9.82-2
# === PATCHES =================================================================
@@ -89,6 +88,23 @@ other legacy tools & utilities.
# === SUBPACKAGES =============================================================
+%package -n initscripts-service
+Summary: Support for service command
+BuildArch: noarch
+
+%shared_requirements
+
+Requires: systemd
+
+Provides: /sbin/service
+
+Obsoletes: %{name} < 9.82-2
+
+%description -n initscripts-service
+This package provides service command.
+
+# ---------------
+
%package -n network-scripts
Summary: Legacy scripts for manipulating of network devices
Requires: %{name}%{?_isa} = %{version}-%{release}
@@ -292,7 +308,6 @@ fi
%{_bindir}/*
%{_sbindir}/consoletype
%{_sbindir}/genhostid
-%{_sbindir}/service
%{_libexecdir}/import-state
%{_libexecdir}/loadmodules
@@ -304,10 +319,20 @@ fi
%{_udevrulesdir}/*
%{_mandir}/man1/*
-%{_mandir}/man8/service.*
# =============================================================================
+%files -n initscripts-service
+
+%dir %{_libexecdir}/%{name}
+%dir %{_libexecdir}/%{name}/legacy-actions
+
+%{_sbindir}/service
+
+%{_mandir}/man8/service.*
+
+# ---------------
+
%files -n network-scripts
%doc doc/examples/
%dir %{_sysconfdir}/sysconfig/network-scripts
diff --git a/usr/sbin/service b/usr/sbin/service
index 4e82bad1..4f0acc07 100755
--- a/usr/sbin/service
+++ b/usr/sbin/service
@@ -1,6 +1,15 @@
#!/bin/bash
-. /etc/init.d/functions
+# Check whether file $1 is a backup or rpm-generated file and should be ignored
+# Copy of the function from etc/rc.d/init.d/functions
+is_ignored_file() {
+ case "$1" in
+ *~ | *.bak | *.old | *.orig | *.rpmnew | *.rpmorig | *.rpmsave)
+ return 0
+ ;;
+ esac
+ return 1
+}
VERSION="$(basename $0) ver. 1.1"
USAGE="Usage: $(basename $0) < option > | --status-all | \