- Remove sysv init scripts
OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=150
This commit is contained in:
parent
7d6e811685
commit
32366f3518
@ -5,6 +5,7 @@ Wed Jul 22 12:12:12 UTC 2020 - ohering@suse.de
|
|||||||
is used in kvp_daemon (bsc#1174443, bsc#1174444)
|
is used in kvp_daemon (bsc#1174443, bsc#1174444)
|
||||||
- Reopen the devices if read() or write() returns errors (9fc3c01a)
|
- Reopen the devices if read() or write() returns errors (9fc3c01a)
|
||||||
- Use either python2 or python3 for lsvmbus (bsc#1093910)
|
- Use either python2 or python3 for lsvmbus (bsc#1093910)
|
||||||
|
- Remove sysv init scripts
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jul 22 09:12:44 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
Wed Jul 22 09:12:44 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# LSB compatible service control script; see http://www.linuxbase.org/spec/
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: hv_fcopy_daemon
|
|
||||||
# Required-Start: $null
|
|
||||||
# Should-Start: $syslog $remote_fs $time
|
|
||||||
# Required-Stop: $null
|
|
||||||
# Should-Stop: $syslog $remote_fs $time
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Short-Description: hv_fcopy_daemon receives files from the host
|
|
||||||
# Description: Start hv_fcopy_daemon to allow the host to copy files into this guest
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# Check for missing binaries (stale symlinks should not happen)
|
|
||||||
# Note: Special treatment of stop for LSB conformance
|
|
||||||
HV_FCOPY_BIN=/usr/sbin/hv_fcopy_daemon
|
|
||||||
test -x $HV_FCOPY_BIN || { echo "$HV_FCOPY_BIN not installed";
|
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
|
||||||
else exit 5; fi; }
|
|
||||||
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
# Reset status of this service
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
echo -n "Starting Hyper-V FCOPY daemon "
|
|
||||||
env PATH=/usr/lib/hyper-v/bin:$PATH \
|
|
||||||
startproc $HV_FCOPY_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
echo -n "Shutting down Hyper-V FCOPY daemon "
|
|
||||||
killproc -TERM $HV_FCOPY_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
try-restart|condrestart)
|
|
||||||
if test "$1" = "condrestart"; then
|
|
||||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
|
||||||
fi
|
|
||||||
$0 status
|
|
||||||
if test $? = 0; then
|
|
||||||
$0 restart
|
|
||||||
else
|
|
||||||
rc_reset # Not running is not a failure.
|
|
||||||
fi
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
## Stop the service and regardless of whether it was
|
|
||||||
## running or not, start it again.
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
force-reload)
|
|
||||||
echo -n "Reload service Hyper-V FCOPY daemon "
|
|
||||||
$0 try-restart
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
rc_failed 3
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo -n "Checking for service Hyper-V FCOPY daemon "
|
|
||||||
checkproc $HV_FCOPY_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
rc_exit
|
|
101
hyper-v.init.sh
101
hyper-v.init.sh
@ -1,101 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# LSB compatible service control script; see http://www.linuxbase.org/spec/
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: hv_kvp_daemon
|
|
||||||
# Required-Start: $null
|
|
||||||
# Should-Start: $syslog $remote_fs $time
|
|
||||||
# Required-Stop: $null
|
|
||||||
# Should-Stop: $syslog $remote_fs $time
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Short-Description: hv_kvp_daemon provides info to the host
|
|
||||||
# Description: Start hv_kvp_daemon to allow the host to query this guest
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# Check for missing binaries (stale symlinks should not happen)
|
|
||||||
# Note: Special treatment of stop for LSB conformance
|
|
||||||
HV_KVP_BIN=/usr/sbin/hv_kvp_daemon
|
|
||||||
test -x $HV_KVP_BIN || { echo "$HV_KVP_BIN not installed";
|
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
|
||||||
else exit 5; fi; }
|
|
||||||
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
# Reset status of this service
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
echo -n "Starting Hyper-V KVP daemon "
|
|
||||||
# The service can not be restarted
|
|
||||||
# IF the currently running kernel is too old, the new daemon is started
|
|
||||||
# anyway. Due to a flaw in the old kernel-user protocol the kernel
|
|
||||||
# will flood /var/log/messages with messages like:
|
|
||||||
# "hv_utils: KVP: user-mode registering done."
|
|
||||||
# This is also caused by old hyper-v.rpms which have a restart command
|
|
||||||
# in their post install script. Catch those old kernels and avoid the
|
|
||||||
# flood, which will easily fill the root partition during an upgrade.
|
|
||||||
case "`uname -r`" in
|
|
||||||
2.*) rc_failed 3 ;;
|
|
||||||
3.0.13-*) rc_failed 3 ;;
|
|
||||||
3.0.26-*) rc_failed 3 ;;
|
|
||||||
3.0.31-*) rc_failed 3 ;;
|
|
||||||
3.0.34-*) rc_failed 3 ;;
|
|
||||||
3.0.38-*) rc_failed 3 ;;
|
|
||||||
3.0.42-*) rc_failed 3 ;;
|
|
||||||
*)
|
|
||||||
env PATH=/usr/lib/hyper-v/bin:$PATH \
|
|
||||||
startproc $HV_KVP_BIN
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
echo -n "Shutting down Hyper-V KVP daemon "
|
|
||||||
killproc -TERM $HV_KVP_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
try-restart|condrestart)
|
|
||||||
if test "$1" = "condrestart"; then
|
|
||||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
|
||||||
fi
|
|
||||||
$0 status
|
|
||||||
if test $? = 0; then
|
|
||||||
$0 restart
|
|
||||||
else
|
|
||||||
rc_reset # Not running is not a failure.
|
|
||||||
fi
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
## Stop the service and regardless of whether it was
|
|
||||||
## running or not, start it again.
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
force-reload)
|
|
||||||
echo -n "Reload service Hyper-V KVP daemon "
|
|
||||||
$0 try-restart
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
rc_failed 3
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo -n "Checking for service Hyper-V KVP daemon "
|
|
||||||
checkproc $HV_KVP_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
rc_exit
|
|
@ -1,82 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# LSB compatible service control script; see http://www.linuxbase.org/spec/
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: hv_vss_daemon
|
|
||||||
# Required-Start: $null
|
|
||||||
# Should-Start: $syslog $remote_fs $time
|
|
||||||
# Required-Stop: $null
|
|
||||||
# Should-Stop: $syslog $remote_fs $time
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Short-Description: hv_vss_daemon assists with host initiated backup
|
|
||||||
# Description: Start hv_vss_daemon to allow the host to snapshot this guest
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# Check for missing binaries (stale symlinks should not happen)
|
|
||||||
# Note: Special treatment of stop for LSB conformance
|
|
||||||
HV_VSS_BIN=/usr/sbin/hv_vss_daemon
|
|
||||||
test -x $HV_VSS_BIN || { echo "$HV_VSS_BIN not installed";
|
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
|
||||||
else exit 5; fi; }
|
|
||||||
|
|
||||||
. /etc/rc.status
|
|
||||||
|
|
||||||
# Reset status of this service
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
echo -n "Starting Hyper-V VSS daemon "
|
|
||||||
env PATH=/usr/lib/hyper-v/bin:$PATH \
|
|
||||||
startproc $HV_VSS_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
echo -n "Shutting down Hyper-V VSS daemon "
|
|
||||||
killproc -TERM $HV_VSS_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
try-restart|condrestart)
|
|
||||||
if test "$1" = "condrestart"; then
|
|
||||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
|
||||||
fi
|
|
||||||
$0 status
|
|
||||||
if test $? = 0; then
|
|
||||||
$0 restart
|
|
||||||
else
|
|
||||||
rc_reset # Not running is not a failure.
|
|
||||||
fi
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
## Stop the service and regardless of whether it was
|
|
||||||
## running or not, start it again.
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
|
|
||||||
# Remember status and be quiet
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
force-reload)
|
|
||||||
echo -n "Reload service Hyper-V VSS daemon "
|
|
||||||
$0 try-restart
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
rc_failed 3
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo -n "Checking for service Hyper-V VSS daemon "
|
|
||||||
checkproc $HV_VSS_BIN
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
rc_exit
|
|
53
hyper-v.spec
53
hyper-v.spec
@ -23,19 +23,8 @@
|
|||||||
|
|
||||||
Name: hyper-v
|
Name: hyper-v
|
||||||
ExclusiveArch: %ix86 x86_64 aarch64
|
ExclusiveArch: %ix86 x86_64 aarch64
|
||||||
# systemd for post 13.1 releases
|
|
||||||
%if 0%{?suse_version} > 1310
|
|
||||||
%define use_systemd 1
|
|
||||||
%else
|
|
||||||
%define use_systemd 0
|
|
||||||
%endif
|
|
||||||
%if %{use_systemd}
|
|
||||||
%{?systemd_requires}
|
%{?systemd_requires}
|
||||||
BuildRequires: pkgconfig(systemd)
|
BuildRequires: pkgconfig(systemd)
|
||||||
%else
|
|
||||||
PreReq: %insserv_prereq
|
|
||||||
Requires(pre): coreutils
|
|
||||||
%endif
|
|
||||||
# Due to usage of char device instead of netlink
|
# Due to usage of char device instead of netlink
|
||||||
Conflicts: kernel < 4.2
|
Conflicts: kernel < 4.2
|
||||||
Summary: Microsoft Hyper-V tools
|
Summary: Microsoft Hyper-V tools
|
||||||
@ -52,11 +41,8 @@ Source5: hyper-v.kvptest.ps1.txt
|
|||||||
Source7: hyper-v.compare-with-upstream.sh
|
Source7: hyper-v.compare-with-upstream.sh
|
||||||
Source9: hyper-v.include.linux.hyperv.h
|
Source9: hyper-v.include.linux.hyperv.h
|
||||||
Source10: hyper-v.tools.hv.hv_kvp_daemon.c
|
Source10: hyper-v.tools.hv.hv_kvp_daemon.c
|
||||||
Source11: hyper-v.init.sh
|
|
||||||
Source12: hyper-v.tools.hv.hv_vss_daemon.c
|
Source12: hyper-v.tools.hv.hv_vss_daemon.c
|
||||||
Source13: hyper-v.init.vss.sh
|
|
||||||
Source14: hyper-v.tools.hv.hv_fcopy_daemon.c
|
Source14: hyper-v.tools.hv.hv_fcopy_daemon.c
|
||||||
Source15: hyper-v.init.fcopy.sh
|
|
||||||
Source20: hyper-v.tools.hv.hv_get_dhcp_info.sh
|
Source20: hyper-v.tools.hv.hv_get_dhcp_info.sh
|
||||||
Source21: hyper-v.tools.hv.hv_get_dns_info.sh
|
Source21: hyper-v.tools.hv.hv_get_dns_info.sh
|
||||||
Source22: hyper-v.tools.hv.hv_set_ifconfig.sh
|
Source22: hyper-v.tools.hv.hv_set_ifconfig.sh
|
||||||
@ -115,12 +101,8 @@ gcc \
|
|||||||
-o %{hv_fcopy_daemon}
|
-o %{hv_fcopy_daemon}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if %{use_systemd}
|
|
||||||
# It is not a callable app anyway, so move it out of the way
|
# It is not a callable app anyway, so move it out of the way
|
||||||
bindir=%{helper_dir}/bin
|
bindir=%{helper_dir}/bin
|
||||||
%else
|
|
||||||
bindir=%{_sbindir}
|
|
||||||
%endif
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${bindir}
|
mkdir -p $RPM_BUILD_ROOT${bindir}
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
||||||
mkdir -p $RPM_BUILD_ROOT%{helper_dir}/bin
|
mkdir -p $RPM_BUILD_ROOT%{helper_dir}/bin
|
||||||
@ -141,7 +123,6 @@ cp -avL %{S:20} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_get_dhcp_info
|
|||||||
cp -avL %{S:21} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_get_dns_info
|
cp -avL %{S:21} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_get_dns_info
|
||||||
cp -avL %{S:22} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_set_ifconfig
|
cp -avL %{S:22} $RPM_BUILD_ROOT%{helper_dir}/bin/hv_set_ifconfig
|
||||||
chmod 755 $RPM_BUILD_ROOT%{helper_dir}/bin/*
|
chmod 755 $RPM_BUILD_ROOT%{helper_dir}/bin/*
|
||||||
%if %{use_systemd}
|
|
||||||
d=$RPM_BUILD_ROOT%{_unitdir}
|
d=$RPM_BUILD_ROOT%{_unitdir}
|
||||||
mkdir -vp ${d}
|
mkdir -vp ${d}
|
||||||
#
|
#
|
||||||
@ -236,25 +217,12 @@ fi
|
|||||||
EOF
|
EOF
|
||||||
chmod 755 $RPM_BUILD_ROOT${bindir}/${helper}
|
chmod 755 $RPM_BUILD_ROOT${bindir}/${helper}
|
||||||
#
|
#
|
||||||
%else
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
|
||||||
install -m755 %{S:11} $RPM_BUILD_ROOT/etc/init.d/%{hv_kvp_daemon}
|
|
||||||
ln -sfvbn ../../etc/init.d/%{hv_kvp_daemon} $RPM_BUILD_ROOT${bindir}/rc%{hv_kvp_daemon}
|
|
||||||
install -m755 %{S:13} $RPM_BUILD_ROOT/etc/init.d/%{hv_vss_daemon}
|
|
||||||
ln -sfvbn ../../etc/init.d/%{hv_vss_daemon} $RPM_BUILD_ROOT${bindir}/rc%{hv_vss_daemon}
|
|
||||||
install -m755 %{S:15} $RPM_BUILD_ROOT/etc/init.d/%{hv_fcopy_daemon}
|
|
||||||
ln -sfvbn ../../etc/init.d/%{hv_fcopy_daemon} $RPM_BUILD_ROOT${bindir}/rc%{hv_fcopy_daemon}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc kvptest.ps1.txt
|
%doc kvptest.ps1.txt
|
||||||
%if %{use_systemd}
|
|
||||||
%{_unitdir}
|
%{_unitdir}
|
||||||
%dir /usr/lib/udev
|
%dir /usr/lib/udev
|
||||||
%{_udevrulesdir}
|
%{_udevrulesdir}
|
||||||
%else
|
|
||||||
/etc/init.d/*
|
|
||||||
%endif
|
|
||||||
%{_sbindir}/*
|
%{_sbindir}/*
|
||||||
%{helper_dir}
|
%{helper_dir}
|
||||||
|
|
||||||
@ -277,9 +245,7 @@ then
|
|||||||
fi
|
fi
|
||||||
rmdir -v /var/opt/hyperv || :
|
rmdir -v /var/opt/hyperv || :
|
||||||
fi
|
fi
|
||||||
%if %{use_systemd}
|
|
||||||
: nothing to do in case of systemd
|
: nothing to do in case of systemd
|
||||||
%endif
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
board_vendor=
|
board_vendor=
|
||||||
@ -298,33 +264,14 @@ then
|
|||||||
fi
|
fi
|
||||||
if test "${board_vendor}" = "Microsoft Corporation" -a "${product_name}" = "Virtual Machine"
|
if test "${board_vendor}" = "Microsoft Corporation" -a "${product_name}" = "Virtual Machine"
|
||||||
then
|
then
|
||||||
%if %{use_systemd}
|
|
||||||
: nothing to do in case of systemd
|
: nothing to do in case of systemd
|
||||||
%else
|
|
||||||
echo "Enabling %{hv_kvp_daemon} on '${product_name}' from '${board_vendor}'"
|
|
||||||
%{insserv_force_if_yast %{hv_kvp_daemon}}
|
|
||||||
echo "Enabling %{hv_vss_daemon} on '${product_name}' from '${board_vendor}'"
|
|
||||||
%{insserv_force_if_yast %{hv_vss_daemon}}
|
|
||||||
echo "Enabling %{hv_fcopy_daemon} on '${product_name}' from '${board_vendor}'"
|
|
||||||
%{insserv_force_if_yast %{hv_fcopy_daemon}}
|
|
||||||
%endif
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%if %{use_systemd}
|
|
||||||
: nothing to do in case of systemd
|
: nothing to do in case of systemd
|
||||||
%else
|
|
||||||
%stop_on_removal %{hv_kvp_daemon}
|
|
||||||
%stop_on_removal %{hv_vss_daemon}
|
|
||||||
%stop_on_removal %{hv_fcopy_daemon}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
# no restart on update because the daemon can not be restarted
|
# no restart on update because the daemon can not be restarted
|
||||||
%if %{use_systemd}
|
|
||||||
: nothing to do in case of systemd
|
: nothing to do in case of systemd
|
||||||
%else
|
|
||||||
%insserv_cleanup
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user