Change in vdsm[master]: spec: Drop el6 support

dkuznets at redhat.com dkuznets at redhat.com
Thu Apr 30 08:15:53 UTC 2015


Dima Kuznetsov has uploaded a new change for review.

Change subject: spec: Drop el6 support
......................................................................

spec: Drop el6 support

Since we no longer need to package for el6, we can significantly reduce
the size of our spec file. This patch removes all the conditionals
dealing with el6, and drops all of the code dealing with sysvinit
as systemd is now available in both el7 and the supported fedoras.

Change-Id: I52bf73f539d9036fbc3468b4faf8a8d6556c9560
Signed-off-by: Dima Kuznetsov <dkuznets at redhat.com>
---
D init/sysvinit/Makefile.am
D init/sysvinit/respawn
D init/sysvinit/supervdsmd.init.in
D init/sysvinit/vdsmd.init.in
D init/upstart/Makefile.am
D init/upstart/supervdsmd.upstart.in
D init/upstart/vdsm-tmpfiles.upstart.in
D init/upstart/vdsmd.upstart.in
M vdsm.spec.in
9 files changed, 4 insertions(+), 862 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/40419/1

diff --git a/init/sysvinit/Makefile.am b/init/sysvinit/Makefile.am
deleted file mode 100644
index 7beba50..0000000
--- a/init/sysvinit/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright 2008-2012 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Refer to the README and COPYING files for full details of the license
-#
-
-include $(top_srcdir)/build-aux/Makefile.subs
-
-nodist_noinst_DATA = \
-	supervdsmd.init \
-	vdsmd.init \
-	$(NULL)
-
-dist_vdsm_SCRIPTS = \
-	respawn \
-	$(NULL)
-
-CLEANFILES = \
-	config.log \
-	$(nodist_noinst_DATA) \
-	$(NULL)
-
-EXTRA_DIST = \
-	supervdsmd.init.in \
-	vdsmd.init.in \
-	$(NULL)
-
-all-local: \
-	$(nodist_noinst_DATA) \
-	$(NULL)
diff --git a/init/sysvinit/respawn b/init/sysvinit/respawn
deleted file mode 100755
index d13effc..0000000
--- a/init/sysvinit/respawn
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash -e
-
-# Copyright 2010 Red Hat, Inc. and/or its affiliates.
-# Released under GPL v2
-#
-# Author:      Dan Kenigsberg <danken at redhat.com>
-#
-# Please contact me if something similar, but more standard, is available.
-
-MINLIFETIME=2
-MAX_THRASH_INTERVAL=30
-POST_FAIL_INTERVAL=900
-
-usage() {
-    echo usage:
-    echo "$0 [options] <slave> [args]"
-    echo "  --masterpid pidfile"
-    echo "  --slavepid pidfile"
-    echo "  --daemon"
-    echo "  --minlifetime seconds"
-    echo "  --thrash seconds"
-    echo
-    echo "make <slave> run, and respawn it on exit"
-    exit 1
-}
-
-while [ "$1" != "${1##-}" ];
-do
-  case "$1" in
-    --minlifetime)
-        MINLIFETIME="$2"
-        shift 2
-        ;;
-    --thrash)
-        MAX_THRASH_INTERVAL="$2"
-        shift 2
-        ;;
-    --masterpid)
-        masterpidfile="$2"
-        shift 2
-        ;;
-    --slavepid)
-        slavepidfile="$2"
-        shift 2
-        ;;
-    --daemon)
-        daemonize=1
-        shift
-	;;
-    --)
-        shift
-        break
-        ;;
-    *)  usage
-        ;;
-  esac
-done
-
-if [ -z "$*" ];
-then
-    usage
-fi
-
-loop() {
-    local d0 d1
-    local thrash_start
-
-    # must use BASHPID since $$ is not updated by &
-    [ ! -z "$masterpidfile" ] && echo $BASHPID > "$masterpidfile"
-    d0=`date +%s`
-    while true
-    do
-        "$@" &
-        [ ! -z "$slavepidfile" ] && echo $! > "$slavepidfile"
-        wait $! || :
-        d1=`date +%s`
-        if [ $[d1-d0] -lt "$MINLIFETIME" ];
-        then
-            if [[ -n "$thrash_start" ]] && \
-               [[ $[d1-thrash_start] -gt "$MAX_THRASH_INTERVAL" ]]; then
-                logger -t respawn -- "slave '$*' died too quickly for more than $MAX_THRASH_INTERVAL seconds, master sleeping for $POST_FAIL_INTERVAL seconds"
-                thrash_start=
-                sleep "$POST_FAIL_INTERVAL"
-            else
-                logger -t respawn -- "slave '$*' died too quickly, respawning slave"
-                [[ -z "$thrash_start" ]] && thrash_start=$d1
-            fi
-        else
-            logger -t respawn -- "slave '$*' died, respawning slave"
-            thrash_start=
-        fi
-        d0=$d1
-    done
-}
-
-if [ -z "$daemonize" ];
-then
-    loop "$@"
-else
-    loop "$@" >/dev/null 2>/dev/null &
-fi
diff --git a/init/sysvinit/supervdsmd.init.in b/init/sysvinit/supervdsmd.init.in
deleted file mode 100755
index f3369c2..0000000
--- a/init/sysvinit/supervdsmd.init.in
+++ /dev/null
@@ -1,116 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2006-2013 Red Hat, Inc. and/or its affiliates.
-#
-# Licensed to you under the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.  See the files README and
-# LICENSE_GPL_v2 which accompany this distribution.
-#
-
-# chkconfig: 2345 99 00
-#
-### BEGIN INIT INFO
-# Provides: supervdsmd
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Description: init script for the Super VDS management server
-# Short-Description: init script for the Super VDS management server
-### END INIT INFO
-
-SUPERVDSM_BIN=@VDSMDIR@/supervdsmServer
-PIDFILE=@VDSMRUNDIR@/supervdsmd.pid
-RESPAWNPIDFILE=@VDSMRUNDIR@/supervdsm_respawn.pid
-SOCKFILE=@VDSMRUNDIR@/svdsm.sock
-prog=supervdsm
-
-[ -f /etc/sysconfig/supervdsmd ] && . /etc/sysconfig/supervdsmd
-. /etc/init.d/functions
-
-log_failure_msg() { echo -n "$@"; failure "$@"; echo; }
-log_success_msg() { echo -n "$@"; success "$@"; echo; }
-
-RETVAL=0
-
-start(){
-        test_already_running && return 0
-
-        DAEMON_COREFILE_LIMIT=unlimited daemon \
-            "@VDSMDIR@/daemonAdapter" -0 /dev/null -1 /dev/null -2 /dev/null \
-            "@VDSMDIR@/respawn" --minlifetime 10 --daemon \
-            --masterpid "${RESPAWNPIDFILE}" "${SUPERVDSM_BIN}" \
-            --sockfile "${SOCKFILE}" --pidfile "${PIDFILE}"
-        RETVAL=$?
-        [ "$RETVAL" -eq 0 ] && log_success_msg "$prog start" || log_failure_msg "$prog start"
-}
-
-test_already_running()
-{
-    if pidofproc -p $RESPAWNPIDFILE >/dev/null || \
-       pidofproc -p $PIDFILE $SUPERVDSM_BIN >/dev/null; then
-        log_success_msg "$prog: already running"
-        return 0
-    fi
-    return 1
-}
-
-stop(){
-    echo "Shutting down supervdsm daemon: "
-    if killproc -p "$RESPAWNPIDFILE"; then
-        log_success_msg "$prog watchdog stop"
-    fi
-    if ! pidofproc -p "$PIDFILE" >/dev/null; then
-        log_failure_msg "$prog: not running"
-        RETVAL=0
-    else
-        killproc -p "$PIDFILE" -d 2
-        RETVAL=$?
-        [ "$RETVAL" -eq 0 ] && log_success_msg "$prog stop" || log_failure_msg "$prog stop"
-    fi
-    return "$RETVAL"
-}
-
-case "$1" in
-     start)
-        start
-        RETVAL=$?
-        ;;
-     stop)
-        stop
-        RETVAL=$?
-        ;;
-     status)
-        pidofproc -p "$PIDFILE" "$SUPERVDSM_BIN" >/dev/null
-        RETVAL=$?
-        if [ "$RETVAL" -eq 0 ]; then
-            echo "Super VDSM daemon server is running"
-        else
-            echo -n "Super VDSM daemon is not running"
-            if pidofproc -p "$RESPAWNPIDFILE" >/dev/null; then
-                echo ", but its watchdog is"
-            else
-                echo
-            fi
-        fi
-        ;;
-     condrestart)
-        pidofproc -p "$PIDFILE" "$SUPERVDSM_BIN" >/dev/null
-        RETVAL=$?
-        if [ "$RETVAL" -eq 0 ]; then
-            $0 stop && $0 start;
-            RETVAL=$?;
-        fi;
-        ;;
-     try-restart|restart|force-reload)
-        $0 stop && $0 start
-        RETVAL=$?
-        ;;
-     *)
-        echo "Usage: $0 {start|stop|status|restart|condrestart|force-reload|try-restart}"
-        RETVAL=2
-esac
-
-exit "$RETVAL"
-
-
-
diff --git a/init/sysvinit/vdsmd.init.in b/init/sysvinit/vdsmd.init.in
deleted file mode 100755
index 6edd89f..0000000
--- a/init/sysvinit/vdsmd.init.in
+++ /dev/null
@@ -1,270 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2006-2010 Red Hat, Inc. and/or its affiliates.
-#
-# Licensed to you under the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.  See the files README and
-# LICENSE_GPL_v2 which accompany this distribution.
-#
-
-# chkconfig: 2345 99 00
-#
-### BEGIN INIT INFO
-# Provides: vdsmd
-# Required-Start: $syslog $network
-# Should-Start: $time
-# Required-Stop: $syslog
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Description: init script for the VDS management server
-# Short-Description: init script for the VDS management server
-### END INIT INFO
-
-VDSM_BIN="@VDSMDIR@/vdsm"
-prog=vdsm
-PIDFILE=@VDSMRUNDIR@/vdsmd.pid
-RESPAWNPIDFILE=@VDSMRUNDIR@/respawn.pid
-NEEDED_SERVICES="multipathd rpcbind ntpd wdmd sanlock libvirtd supervdsmd"
-CONFLICTING_SERVICES="libvirt-guests ksmtuned"
-LOCK_FILE="/var/lock/subsys/vdsmd"
-VDSM_TOOL="@BINDIR@/vdsm-tool"
-NICE_LOWEST=-20
-VDSMD_INIT_COMMON="@LIBEXECDIR@/vdsmd_init_common.sh"
-RETVAL=0
-
-SYSTEMCTL_SKIP_REDIRECT=true
-
-[ -f /etc/sysconfig/vdsm ] && . /etc/sysconfig/vdsm
-. /etc/init.d/functions
-
-log_failure_msg() { printf "$@"; failure "$@"; echo; }
-log_success_msg() { printf "$@"; success "$@"; echo; }
-
-shutdown_conflicting_srv() {
-    local srv
-    local ret_val
-    local conflicting_services="$1"
-
-    for srv in ${conflicting_services}; do
-        if initctl status "${srv}" >/dev/null 2>&1; then
-            # When srv is Upstart service, status srv always returns 0
-            initctl stop "${srv}" || : # stop fails when already down
-            initctl status "${srv}" | grep -q stop/waiting
-        elif [ -x "/etc/init.d/${srv}" ]; then
-            if service "${srv}" status >/dev/null 2>&1; then
-                service "${srv}" stop
-            fi
-        else
-            true
-        fi
-        ret_val=$?
-        if [ "${ret_val}" -ne 0 ]; then
-            log_failure_msg "${prog}: Stop conflicting ${srv}"
-            return "${ret_val}"
-        fi
-    done
-    return 0
-}
-
-start_needed_srv() {
-    local srv
-    local ret_val
-    local needed_services="$1"
-
-    for srv in ${needed_services}; do
-        if initctl status "${srv}" >/dev/null 2>&1; then
-            # When srv is Upstart service, status srv always returns 0
-            initctl start "${srv}" || : # start fails when already running
-            initctl status "${srv}" | grep -q start/running
-        else
-            service "${srv}" status >/dev/null 2>&1 || service "${srv}" start
-        fi
-        ret_val=$?
-        if [ "${ret_val}" -ne 0 ]; then
-            log_failure_msg "${prog}: Start dependent ${srv}"
-            return "${ret_val}"
-        fi
-    done
-}
-
-start_network() {
-    # Check if there are unactivated VDSM devices
-    local interfaces dev static_devs activated_devs
-
-    pushd /etc/sysconfig/network-scripts/ > /dev/null
-
-    # copied from /etc/init.d/network
-    interfaces=$(ls ifcfg-* | \
-            LC_ALL=C sed -e "$__sed_discard_ignored_files" \
-                   -e '/\(ifcfg-lo$\|:\|ifcfg-.*-range\)/d' \
-                   -e '{ s/^ifcfg-//g;s/[0-9]/ &/}' | \
-            LC_ALL=C sort -k 1,1 -k 2n | \
-            LC_ALL=C sed 's/ //')
-
-    for dev in $interfaces; do
-        ifcfg="ifcfg-$dev"
-        grep -q '# Generated by VDSM version' "$ifcfg" || continue
-        grep -q 'ONBOOT=yes' "$ifcfg" || continue
-        static_devs="$static_devs $dev"
-    done
-    popd > /dev/null
-
-    activated_devs="`service network status | tail -1`"
-
-    for static_dev in $static_devs; do
-        if [[ $activated_devs != *"$static_dev"* ]]; then
-            service network start
-            ret_val=$?
-            if [ "${ret_val}" -ne 0 ]; then
-                log_failure_msg "${prog}: Start dependent network"
-                return "${ret_val}"
-            fi
-            break
-        fi
-    done
-}
-
-test_already_running()
-{
-    if pidofproc -p "$RESPAWNPIDFILE" >/dev/null || \
-       pidofproc -p "$PIDFILE" "$VDSM_BIN" >/dev/null; then
-        log_success_msg "$prog: already running"
-        return 0
-    fi
-    return 1
-}
-
-reconfigure() {
-    if [ "${1}" = "force" ] || ! "$VDSM_TOOL" is-configured; then
-        "$VDSM_TOOL" configure "--force"
-    fi
-}
-
-restore_nets(){
-    "$VDSM_TOOL" restore-nets
-    return 0
-}
-
-unified_network_persistence_upgrade(){
-    echo 'Upgrading to unified persistence if needed'
-    "$VDSM_TOOL" ${UPGRADE_LOGGING_PARAMS} upgrade-unified-persistence
-}
-
-upgrade_300_nets(){
-    echo 'Upgrading to v3.x networking if needed'
-    "$VDSM_TOOL" ${UPGRADE_LOGGING_PARAMS} upgrade-3.0.0-networks
-}
-
-start() {
-    test_already_running && return 0
-
-    start_network || return 1
-    shutdown_conflicting_srv "${CONFLICTING_SERVICES}" || return 1
-    start_needed_srv "${NEEDED_SERVICES}" || return 1
-
-    # "service iscsid start" may not start becasue we configure node.startup to
-    # manual. See /etc/init.d/iscsid.
-    service iscsid status >/dev/null 2>&1 || service iscsid force-start \
-        || return 1
-
-    "${VDSMD_INIT_COMMON}" --pre-start || return 1
-
-    unified_network_persistence_upgrade || return 1
-    restore_nets || return 1
-    upgrade_300_nets || return 1
-
-
-    echo $"Starting up vdsm daemon: "
-    DAEMON_COREFILE_LIMIT=unlimited NICELEVEL="${NICE_LOWEST}" daemon \
-        --user=vdsm "@VDSMDIR@/daemonAdapter" -0 /dev/null -1 /dev/null \
-        -2 /dev/null --syslog "@VDSMDIR@/respawn" --minlifetime 10 \
-        --daemon --masterpid "${RESPAWNPIDFILE}" "${VDSM_BIN}" \
-        --pidfile "${PIDFILE}" || return 1
-    touch "${LOCK_FILE}"
-    return 0
-}
-
-stop() {
-    echo $"Shutting down vdsm daemon: "
-    if killproc -p "$RESPAWNPIDFILE"; then
-        log_success_msg $"$prog watchdog stop"
-    fi
-    if ! pidofproc -p "$PIDFILE" >/dev/null; then
-        log_failure_msg "$prog: not running"
-        RETVAL=0
-    else
-        killproc -p "$PIDFILE" -d @SERVICE_STOP_TIMEOUT@
-        RETVAL=$?
-        [ "$RETVAL" = 0 ] && "@RM_PATH@" -f "$LOCK_FILE" > /dev/null 2>&1
-    fi
-    "${VDSMD_INIT_COMMON}" --post-stop
-    return "$RETVAL"
-}
-
-lock_op() {
-    {
-        if ! flock -n 9; then
-            log_failure_msg $"cannot ${1} ${prog}, operation is locked"
-            false
-        elif ( "${1}" 9<&- ); then
-            log_success_msg $"${prog} ${1}"
-        else
-            log_failure_msg $"${prog} ${1}"
-            false
-        fi
-     } 9<$0
-}
-
-case "$1" in
-     start)
-         lock_op start
-         RETVAL=$?
-    ;;
-     stop)
-        lock_op stop
-        RETVAL=$?
-    ;;
-     status)
-    pidofproc -p "$PIDFILE" "$VDSM_BIN" >/dev/null
-    RETVAL=$?
-    if [ "$RETVAL" -eq 0 ]; then
-        echo "VDS daemon server is running"
-    else
-        printf "VDS daemon is not running"
-        if pidofproc -p "$RESPAWNPIDFILE" >/dev/null; then
-            echo ", and its watchdog is running"
-        else
-            echo
-        fi
-    fi
-    ;;
-     condrestart)
-    pidofproc -p "$PIDFILE" "$VDSM_BIN" >/dev/null
-    RETVAL=$?
-    if [ "$RETVAL" -eq 0 ]; then
-        "$0" stop && "$0" start;
-        RETVAL=$?;
-    fi;
-        ;;
-     try-restart)
-    "$0" stop && "$0" start
-    RETVAL=$?
-    ;;
-     restart|force-reload)
-    "$0" stop
-    "$0" start
-    RETVAL=$?
-    ;;
-    reconfigure)
-        # Jump over 'reconfigure'
-        shift 1
-        reconfigure "$@"
-    RETVAL=$?
-    ;;
-     *)
-    echo "Usage: $0 {start|stop|status|restart|force-reload|try-restart|condrestart}"
-    RETVAL=2
-esac
-
-exit "$RETVAL"
diff --git a/init/upstart/Makefile.am b/init/upstart/Makefile.am
deleted file mode 100644
index e689fdf..0000000
--- a/init/upstart/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright 2013 IBM, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Refer to the README and COPYING files for full details of the license
-#
-
-include $(top_srcdir)/build-aux/Makefile.subs
-
-nodist_noinst_DATA = \
-	supervdsmd.upstart \
-	vdsm-tmpfiles.upstart \
-	vdsmd.upstart \
-	$(NULL)
-
-CLEANFILES = \
-	config.log \
-	$(nodist_noinst_DATA) \
-	$(NULL)
-
-EXTRA_DIST = \
-	supervdsmd.upstart.in \
-	vdsm-tmpfiles.upstart.in \
-	vdsmd.upstart.in \
-	$(NULL)
-
-all-local: \
-	$(nodist_noinst_DATA) \
-	$(NULL)
diff --git a/init/upstart/supervdsmd.upstart.in b/init/upstart/supervdsmd.upstart.in
deleted file mode 100644
index bc55702..0000000
--- a/init/upstart/supervdsmd.upstart.in
+++ /dev/null
@@ -1,20 +0,0 @@
-# supervdsmd - Auxiliary vdsm service for running helper functions as root
-#
-
-description "Auxiliary vdsm service for running helper functions as root"
-
-start on runlevel [2345] and started libvirt-bin
-stop on runlevel [!2345]
-chdir "@VDSMDIR@"
-console log
-respawn
-
-# All commands called inside this script section except the daemon itself
-# should not fork, otherwise Upstart traces the wrong pid.
-# ".", "[", "&&" are built-in command or key-word, no fork.
-# bash exec does not fork, just execve the target binary.
-# So no "expect" stanza is needed.
-script
-    [ -f "/etc/default/supervdsmd" ] && . "/etc/default/supervdsmd"
-    exec "@VDSMDIR@/daemonAdapter" "@VDSMDIR@/supervdsmServer" --sockfile "@VDSMRUNDIR@/svdsm.sock"
-end script
diff --git a/init/upstart/vdsm-tmpfiles.upstart.in b/init/upstart/vdsm-tmpfiles.upstart.in
deleted file mode 100644
index a0b6b73..0000000
--- a/init/upstart/vdsm-tmpfiles.upstart.in
+++ /dev/null
@@ -1,24 +0,0 @@
-# vdsm-tmpfiles - Automatically create tempfiles under /var/run for vdsm
-#
-
-description "Automatically create tempfiles under /var/run for vdsm"
-
-start on startup
-console log
-
-task
-
-script
-while read fileType filePath fileMode fileUser fileGroup ; do
-    if [ ! -e "$filePath" ]; then
-        if [ "$fileType" = "d" ]; then
-            @MKDIR_P@ "$filePath"
-        else
-            echo "Type $fileType handling is not implemented"
-            exit 1
-        fi
-    fi
-    "@CHOWN_PATH@" $fileUser:$fileGroup "$filePath"
-    "@CHMOD_PATH@" $fileMode "$filePath"
-done < "@CONFDIR@/vdsm-tmpfiles.conf"
-end script
diff --git a/init/upstart/vdsmd.upstart.in b/init/upstart/vdsmd.upstart.in
deleted file mode 100644
index 1eab48b..0000000
--- a/init/upstart/vdsmd.upstart.in
+++ /dev/null
@@ -1,39 +0,0 @@
-# vdsmd - Virtual Desktop Server Manager
-#
-
-description "Virtual Desktop Server Manager"
-
-start on runlevel [2345] and started networking and started portmap and started libvirt-bin and started supervdsmd
-stop on runlevel [!2345]
-kill timeout @SERVICE_STOP_TIMEOUT@
-chdir "@VDSMDIR@"
-console log
-nice -20
-respawn
-
-pre-start script
-    "@BINDIR@/vdsm-tool" load-needed-modules
-    service wdmd restart
-    for srv in networking ntp open-iscsi multipath-tools wdmd sanlock portmap libvirt-bin supervdsmd; do
-        if status "${srv}" >/dev/null 2>&1; then
-            # When srv is Upstart service, status srv always returns 0
-            start "${srv}" || true
-            status "${srv}" | grep -q start/running
-        else
-            service "${srv}" status >/dev/null 2>&1 || service "${srv}" start
-        fi
-    done
-    "@LIBEXECDIR@/vdsmd_init_common.sh" --pre-start
-end script
-
-# All commands called inside this script section except the daemon itself
-# should not fork, otherwise Upstart traces the wrong pid.
-# ".", "[", "&&" are built-in command or key-word, no fork.
-# bash exec does not fork, just execve the target binary.
-# So no "expect" stanza is needed.
-script
-    [ -f "/etc/default/vdsmd" ] && . "/etc/default/vdsmd"
-    exec start-stop-daemon --chuid @VDSMUSER@:@VDSMGROUP@ --start --exec "@VDSMDIR@/daemonAdapter" -- -0 /dev/null -1 /dev/null -2 /dev/null "@VDSMDIR@/vdsm"
-end script
-
-post-stop exec "@LIBEXECDIR@/vdsmd_init_common.sh" --post-stop
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 76ed135..38eb2b4 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -54,21 +54,10 @@
 %global with_vhostmd 1
 %endif
 
-%if 0%{?fedora} || 0%{?rhel} >= 7
-%global with_systemd 1
-%endif
-
-%if 0%{?fedora} || 0%{?rhel} >= 7
 %global with_chown_hack 1
-%endif
 
-%if 0%{?rhel} == 6
-%global _udevrulesdir /lib/udev/rules.d/
-%global _udevexecdir /lib/udev/
-%else
 %global _udevrulesdir /usr/lib/udev/rules.d/
 %global _udevexecdir /usr/lib/udev/
-%endif
 
 Name:           %{vdsm_name}
 Version:        @PACKAGE_VERSION@
@@ -83,11 +72,6 @@
 
 %if !%{fedora_koji_build}
 ExclusiveArch: x86_64 ppc64 ppc64le
-%endif
-
-%if 0%{?rhel} <= 6
-# qemu-img is x86_64 only on RHEL6
-ExclusiveArch: x86_64
 %endif
 
 BuildRequires: cyrus-sasl-lib
@@ -115,15 +99,7 @@
 BuildRequires: python-pthreading
 BuildRequires: qemu-img
 BuildRequires: rpm-python
-%if 0%{?rhel} == 6
-BuildRequires: python-simplejson >= 2.0.9
-BuildRequires: policycoreutils-python > 2.0.83-19.47
-BuildRequires: python-argparse
-BuildRequires: python-ordereddict
-%endif
-%if 0%{?rhel} > 6 || 0%{?fedora}
 BuildRequires: python-blivet
-%endif
 
 # Autotools BuildRequires
 %if 0%{?enable_autotools}
@@ -138,9 +114,7 @@
 BuildRequires: python-pep8
 %endif
 
-%if 0%{?with_systemd}
 BuildRequires: systemd-units
-%endif
 
 Requires: ethtool
 Requires: which
@@ -185,15 +159,12 @@
 %else # fedora
 Requires: libguestfs-tools-c >= 1:1.26.7-2
 %endif
-
-%if 0%{?rhel} >= 7 || 0%{?fedora}
 Requires: libvirt-daemon-config-nwfilter
 Requires: libvirt-daemon-driver-network
 Requires: libvirt-daemon-driver-nwfilter
 Requires: libvirt-daemon-driver-qemu
-%endif
 
-%if 0%{?rhel} >= 7
+%if 0%{?rhel}
 %if 0%{?rhev_build}
 Requires: libvirt-daemon >= 1.2.8-16.el7_1.2
 Requires: libvirt-python >= 1.2.8-7.el7_1.1
@@ -202,11 +173,6 @@
 Requires: libvirt-python
 %endif # rhev_build
 %endif # rhel 7
-
-%if 0%{?rhel} == 6
-Requires: libvirt >= 0.10.2-29.el6_5.4
-Requires: libvirt-python
-%endif
 
 %if 0%{?fedora} >= 22
 Requires: libvirt-daemon >= 1.2.14
@@ -222,11 +188,7 @@
 
 # iscsi-intiator versions
 %if 0%{?rhel}
-%if 0%{?rhel} >= 7
 Requires: iscsi-initiator-utils
-%else
-Requires: iscsi-initiator-utils >= 6.2.0.872-15
-%endif # rhel 7
 %else # fedora
 Requires: iscsi-initiator-utils >= 6.2.0.873-21
 %endif
@@ -234,7 +196,6 @@
 Requires: sanlock >= 2.8, sanlock-python
 
 %if 0%{?rhel}
-%if 0%{?rhel} >= 7
 Requires: device-mapper-multipath >= 0.4.9-68
 Requires: e2fsprogs
 Requires: fence-agents-all
@@ -242,19 +203,6 @@
 Requires: python
 Requires: policycoreutils-python
 Requires: selinux-policy-targeted >= 3.13.1-16.el7
-%else
-Requires: python
-Requires: device-mapper-multipath >= 0.4.9-75
-Requires: e2fsprogs >= 1.41.12-11
-Requires: fence-agents
-Requires: kernel >= 2.6.32-465
-Requires: initscripts >= 9.03.31-2.el6_3.1
-Requires: policycoreutils >= 2.0.83-19.30
-Requires: policycoreutils-python >= 2.0.83-19.47.el6_6.1
-Requires: selinux-policy-targeted >= 3.7.19-260.el6_6.2
-Requires: lvm2 >= 2.02.100-5
-Requires: logrotate < 3.8.0
-%endif
 %else
 Requires: fence-agents-all
 Requires: kernel >= 3.11.3-201
@@ -279,13 +227,8 @@
 %endif
 
 %if 0%{?rhel}
-%if 0%{?rhel} >= 7
 Requires: qemu-kvm%{?rhev_suffix} >= 10:1.5.3-60.el7
 Requires: qemu-img%{?rhev_suffix} >= 10:1.5.3-60.el7
-%else
-Requires: qemu-kvm%{?rhev_suffix} >= 2:0.12.1.2-2.422
-Requires: qemu-img%{?rhev_suffix} >= 2:0.12.1.2-2.422
-%endif  # rhel > = 7
 %else
 Requires: qemu-kvm >= 2:2.0.0-1
 Requires: qemu-img >= 2:2.0.0-1
@@ -361,10 +304,6 @@
 Requires:       %{name}-python = %{version}-%{release}
 Requires:       %{name}-yajsonrpc = %{version}-%{release}
 Obsoletes:      vdsm-api < 4.16
-%if 0%{?rhel} == 6
-Requires:       python-ordereddict
-Requires:       python-simplejson >= 2.0.9
-%endif
 
 %description jsonrpc
 A Json-based RPC interface that serves as the protocol for libvdsm.
@@ -391,11 +330,7 @@
 %package bootstrap
 Summary:        VDSM bootstrapping package
 BuildArch:      noarch
-%if 0%{?rhel} < 7
-Requires: python-ethtool >= 0.6-3
-%else
 Requires: python-ethtool >= 0.8-1
-%endif
 
 %description bootstrap
 VDSM bootstrapping package. Used for delivering the bootstrap code onto the
@@ -730,9 +665,6 @@
 
 %prep
 %setup -q
-%if 0%{?rhel} == 6
-sed -i '/ su /d' vdsm/vdsm-logrotate.conf.in
-%endif
 
 %build
 %if 0%{?enable_autotools}
@@ -769,10 +701,6 @@
 install -dDm 0755 %{buildroot}@VDSMLOGDIR@
 touch %{buildroot}@VDSMLOGDIR@/{connectivity.log,mom.log,supervdsm.log,vdsm.log}
 
-# Install the respawn utility
-install -Dm 0755 init/sysvinit/respawn \
-                 %{buildroot}%{_datadir}/%{vdsm_name}/respawn
-
 # Install the lvm rules
 install -Dm 0644 vdsm/storage/vdsm-lvm.rules \
                  %{buildroot}%{_udevrulesdir}/12-vdsm-lvm.rules
@@ -780,7 +708,6 @@
 install -Dm 0644 vdsm/limits.conf \
                  %{buildroot}/etc/security/limits.d/99-vdsm.conf
 
-%if 0%{?with_systemd}
 install -Dm 0755 init/systemd/systemd-vdsmd %{buildroot}/usr/lib/systemd/systemd-vdsmd
 install -Dm 0644 init/systemd/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
 install -Dm 0644 init/systemd/vdsm-network.service %{buildroot}%{_unitdir}/vdsm-network.service
@@ -792,18 +719,8 @@
                  %{buildroot}%{_unitdir}/vdsm-reg.service
 install -Dm 0644 vdsm/vdsm-modules-load.d.conf \
                  %{buildroot}%{_sysconfdir}/modules-load.d/vdsm.conf
-%else
-# Install the SysV init scripts
-install -Dm 0755 init/sysvinit/vdsmd.init %{buildroot}%{_initrddir}/vdsmd
-install -Dm 0755 init/sysvinit/supervdsmd.init %{buildroot}%{_initrddir}/supervdsmd
-
-install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg
-%endif
-
-%if 0%{?with_systemd}
 install -Dm 0644 init/systemd/vdsm-tmpfiles.d.conf \
                  %{buildroot}%{_tmpfilesdir}/%{vdsm_name}.conf
-%endif
 
 %if 0%{?rhel}
 # This is not commonplace, but we want /var/log/core to be a world-writable
@@ -812,19 +729,12 @@
 %endif
 
 # Install the polkit for libvirt
-%if 0%{?fedora} || 0%{?rhel} >= 7
 install -Dm 0644 vdsm/vdsm-libvirt-access.rules \
                  %{buildroot}%{_polkitdir}/10-vdsm-libvirt-access.rules
-%else
-install -Dm 0644 vdsm/vdsm-libvirt-access.pkla \
-                 %{buildroot}%{_polkitdir}/10-vdsm-libvirt-access.pkla
-%endif
 
 # Install the libvirt hook for cleaning up the XML
-%if 0%{?fedora} || 0%{?rhel} >= 7
 install -Dm 0755 vdsm/virt/libvirt-hook.sh \
                  %{buildroot}%{_sysconfdir}/libvirt/hooks/qemu
-%endif
 
 %check
 %if 0%{?with_check}
@@ -879,13 +789,6 @@
 fi
 /sbin/restorecon -R /var/log/core >/dev/null 2>&1
 # hack until we replace core dump with abrt
-
-%if ! 0%{?with_systemd}
-if [ "$1" -eq 1 ] ; then
-    /sbin/chkconfig --add vdsmd
-    /sbin/chkconfig --add supervdsmd
-fi
-%else
 /bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || :
 if [ "$1" -eq 1 ] ; then
     /bin/systemctl enable vdsmd.service >/dev/null 2>&1 || :
@@ -894,50 +797,15 @@
 fi
 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 exit 0
-%endif
 
 %preun
 if [ "$1" -eq 0 ]; then
         %{_bindir}/vdsm-tool remove-config
 fi
 
-%if ! 0%{?with_systemd}
-if [ "$1" -eq 0 ]
-then
-    /sbin/service vdsmd stop > /dev/null 2>&1 || :
-    /sbin/chkconfig --del vdsmd
-    /sbin/service supervdsmd stop > /dev/null 2>&1 || :
-    /sbin/chkconfig --del supervdsmd
-
-    /bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
-        /etc/sysctl.conf
-
-    %{_bindir}/vdsm-tool remove-saslpasswd
-
-    if /sbin/initctl status libvirtd >/dev/null 2>/dev/null ; then
-        /sbin/initctl stop libvirtd  >/dev/null 2>/dev/null
-        rm -f /etc/init/libvirtd.conf
-
-        /sbin/chkconfig libvirtd on
-        /sbin/service libvirtd start >/dev/null
-    fi
-fi
-%else
-%if 0%{?with_systemd}
 %systemd_preun vdsmd.service
 %systemd_preun vdsm-network.service
 %systemd_preun supervdsmd.service
-%else
-if [ "$1" -eq 0 ]; then
-    /bin/systemctl --no-reload disable vdsmd.service > /dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable supervdsmd.service > /dev/null 2>&1 || :
-    /bin/systemctl stop vdsmd.service > /dev/null 2>&1 || :
-    /bin/systemctl stop vdsm-network.service > /dev/null 2>&1 || :
-    /bin/systemctl stop supervdsmd.service > /dev/null 2>&1 || :
-fi
-exit 0
-%endif
-%endif
 
 %postun
 if [ "$1" -ge 1 ]; then
@@ -968,11 +836,9 @@
             # fallback to vdsmd reconfigure api - This change may be removed
             # when vdsm won't support any downgrade\upgrade to versions that
             # don't include vdsm-tool configure api (vdsm <= 3.3)
-            for f in '/usr/lib/systemd/systemd-vdsmd' '/etc/init.d/vdsmd'; do
-                if [ -f "${f}" ]; then
-                    "${f}" reconfigure >/dev/null 2>&1 || :
-                fi
-            done
+            if [ -f "/usr/lib/systemd/systemd-vdsmd" ]; then
+                "/usr/lib/systemd/systemd-vdsmd" reconfigure >/dev/null 2>&1 || :
+            fi
         fi
     fi
 
@@ -985,69 +851,19 @@
 fi
 exit 0
 
-%if 0%{?rhel} == 6
-# In el6, We configure libvirt to use upstart without the libvirt.rpm's
-# awareness. Thus, we must stop/restart libvirt ourselves when the
-# libvirt.rpm is removed/upgraded.
-%triggerun -- libvirt
-if [ "$2" -eq "0" ]; then
-    /sbin/initctl stop libvirtd > /dev/null 2>&1 || :
-fi
-
-%triggerpostun -- libvirt
-if [ "$2" -ge "1" ]; then
-    /sbin/initctl restart libvirtd > /dev/null 2>&1 || :
-fi
-%endif
-
 %post reg
-%if ! 0%{?with_systemd}
-if [ "$1" -eq 1 ] ; then
-    /sbin/chkconfig --add vdsm-reg
-fi
-%else
-%if 0%{?with_systemd}
 %systemd_post vdsm-reg.service
-%else
-if [ "$1" -eq 1 ] ; then
-    /bin/systemctl enable vdsm-reg.service >/dev/null 2>&1 || :
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
-exit 0
-%endif
-%endif
 
 %preun reg
-%if ! 0%{?with_systemd}
-if [ "$1" -eq 0 ]
-then
-    /sbin/service vdsm-reg stop > /dev/null 2>&1 || :
-    /sbin/chkconfig --del vdsm-reg
-fi
-%else
-%if 0%{?with_systemd}
 %systemd_preun vdsm-reg.service
-%else
-if [ "$1" -eq 0 ]; then
-    /bin/systemctl --no-reload disable vdsm-reg.service > /dev/null 2>&1 || :
-    /bin/systemctl stop vdsm-reg.service > /dev/null 2>&1 || :
-fi
-exit 0
-%endif
-%endif
 
 %files
 %defattr(-, root, root, -)
 %doc COPYING README lib/vdsm/vdsm.conf.sample
-%if 0%{?with_systemd}
 /usr/lib/systemd/systemd-vdsmd
 %{_unitdir}/vdsmd.service
 %{_unitdir}/vdsm-network.service
 %{_unitdir}/supervdsmd.service
-%else
-%{_initrddir}/vdsmd
-%{_initrddir}/supervdsmd
-%endif
 
 %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
 %ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/connectivity.log
@@ -1119,18 +935,12 @@
 %config(noreplace) %{_sysconfdir}/%{vdsm_name}/logrotate/vdsm
 %config(noreplace) %{_sysconfdir}/rwtab.d/vdsm
 %config(noreplace) %{_sysconfdir}/sysctl.d/vdsm.conf
-%if 0%{?with_systemd}
 %config(noreplace) %{_sysconfdir}/modules-load.d/vdsm.conf
-%endif
-%if 0%{?with_systemd}
 %config(noreplace) %{_tmpfilesdir}/%{vdsm_name}.conf
-%endif
 %{_sysconfdir}/dhcp/dhclient.d/sourceRoute.sh
 %{_sysconfdir}/sudoers.d/50_vdsm
 %{_sysconfdir}/cron.hourly/vdsm-logrotate
-%if 0%{?fedora} || 0%{?rhel} >= 7
 %{_sysconfdir}/libvirt/hooks/qemu
-%endif
 %{_datadir}/%{vdsm_name}/logUtils.py*
 %{_datadir}/%{vdsm_name}/dsaversion.py*
 %{_libexecdir}/%{vdsm_name}/curl-img-wrap
@@ -1289,11 +1099,7 @@
 %if 0%{?rhel}
 %dir %{_localstatedir}/log/core
 %endif
-%if 0%{?fedora} || 0%{?rhel} >= 7
 %{_polkitdir}/10-vdsm-libvirt-access.rules
-%else
-%{_polkitdir}/10-vdsm-libvirt-access.pkla
-%endif
 
 %defattr(-, %{vdsm_user}, %{qemu_group}, -)
 %dir %{_localstatedir}/lib/libvirt/qemu/channels
@@ -1362,11 +1168,7 @@
 %{_datadir}/%{vdsm_name}/config.py*
 %{_datadir}/%{vdsm_name}/netinfo.py*
 %endif
-%if 0%{?with_systemd}
 %exclude %{python_sitelib}/%{vdsm_name}/tool/load_needed_modules.py*
-%else
-%{python_sitelib}/%{vdsm_name}/tool/load_needed_modules.py*
-%endif
 %{python_sitelib}/%{vdsm_name}/tool/configfile.py*
 %{python_sitelib}/%{vdsm_name}/tool/dummybr.py*
 %{python_sitelib}/%{vdsm_name}/tool/dump_bonding_defaults.py*
@@ -1675,12 +1477,8 @@
 %config(noreplace) %{_sysconfdir}/%{vdsm_reg}/logger.conf
 %ghost %dir /data
 %ghost %dir %attr(0775, root, root) /data/updates
-%if 0%{?with_systemd}
 /usr/lib/systemd/systemd-vdsm-reg
 %{_unitdir}/vdsm-reg.service
-%else
-%{_initrddir}/vdsm-reg
-%endif
 %{_datadir}/%{vdsm_reg}/vdsm-reg-setup
 %{_datadir}/%{vdsm_reg}/vdsm-complete
 %{_datadir}/%{vdsm_reg}/vdsm-gen-cert


-- 
To view, visit https://gerrit.ovirt.org/40419
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52bf73f539d9036fbc3468b4faf8a8d6556c9560
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets at redhat.com>


More information about the vdsm-patches mailing list