Package: kexec-tools
Version: 1:2.0.7-2
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

After reading that systemd was now supported, I tried using systemd and
instead opted for installing sysvinit-core.

However, with sysvinit-core installed, kexec-load apparently doesn't run and
hence a kernel doesn't get loaded for kexec to run.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

I added a few extra output lines and testing that /boot was mounted in the
kexec-load script, but kexec-load was apparently not run.

   * What was the outcome of this action?
   * What outcome did you expect instead?

How should I verify that kexec-load is being called on shutdown and where
the process is failing?

*** End of the template - remove these template lines ***


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 
'oldstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.17.0+ (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages kexec-tools depends on:
ii  debconf [debconf-2.0]  1.5.53
ii  libc6                  2.19-11

kexec-tools recommends no packages.

kexec-tools suggests no packages.

-- Configuration Files:
/etc/default/kexec changed:
LOAD_KEXEC=true
KERNEL_IMAGE="/boot/vmlinuz-3.17.0+"
INITRD="/boot/initrd.img-3.17.0+"
APPEND=""
USE_GRUB_CONFIG=false

/etc/init.d/kexec-load changed:
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NOKEXECFILE=/tmp/no-kexec-reboot
. /lib/lsb/init-functions
test -r /etc/default/kexec && . /etc/default/kexec
process_grub_entry() {
        initrd_image=
        while read command args; do
                if [ "$command" = "linux" ]; then
                        echo "$args" | while read kernel append; do
                        echo KERNEL_IMAGE=\"${prefix}${kernel}\"
                        echo APPEND=\"${append}\"
                        done
                elif [ "$command" = "initrd" ]; then
                        initrd_image=${prefix}${args}
                fi
        done
        echo INITRD=\"$initrd_image\"
}
get_grub_kernel() {
        test -f /boot/grub/grub.cfg || return
        local prefix
        mountpoint -q /boot && prefix=/boot || prefix=
        data=$(cat /boot/grub/grub.cfg)
        default=$(echo "$data" | awk '/^set default/ {print $2}' | cut -d'"' 
-f2)
        if [ "$default" = '${saved_entry}' ]; then 
                default=$(sed -ne 's/^saved_entry=//p' /boot/grub/grubenv)
        fi
        if [ -z "$default" ]; then
                default=0
        fi
        start_offset=$((default + 1))
        end_offset=$((default + 2))
        # grub entries start with "menuentry" commands.  Get the line 
        # numbers that surround the first entry
        offsets=$(echo "$data" | grep -n '^[[:space:]]*menuentry[[:space:]]' | 
cut -d: -f1)
        begin=$(echo "$offsets" | tail -n+$start_offset | head -n1)
        end=$(echo "$offsets" | tail -n+$end_offset | head -n1)
        # If this is the last entry, we need to read to the end of the file
        # or to the end of boot entry section
        if [ -z "$end" ]; then
                numlines=$(echo "$data" | tail --lines=+$begin | grep -n "^### 
END" | head -1 | cut -d: -f1)
                end=$((begin + numlines - 1))
        fi
        length=$((end - begin))
        entry=$(echo "$data" | tail -n+$begin | head -n$length)
        eval $(echo "$entry" | process_grub_entry)
}
do_stop () {
        test "$LOAD_KEXEC" = "true" || exit 0
        test -x /sbin/kexec || exit 0
        test "x`cat /sys/kernel/kexec_loaded`y" = "x1y" && exit 0
        if [ -f $NOKEXECFILE ]
        then
                /bin/rm -f $NOKEXECFILE
                exit 0
        fi
        test "$USE_GRUB_CONFIG" = "true" && get_grub_kernel
        REAL_APPEND="$APPEND"
        test -z "$REAL_APPEND" && REAL_APPEND="`cat /proc/cmdline`"
        log_action_begin_msg "Loading new kernel image into memory"
        echo "Loading new kernel image into memory"
        if [ -z "$INITRD" ]
        then
                /sbin/kexec -l "$KERNEL_IMAGE" --append="$REAL_APPEND"
        else
                /sbin/kexec -l "$KERNEL_IMAGE" --initrd="$INITRD" 
--append="$REAL_APPEND"
        fi
        log_action_end_msg $?
}
case "$1" in
  start)
        # No-op
        ;;
  restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
  stop)
        # We want kexec reboot only if current command is reboot
        echo "kexec stop called"
        systemctl list-jobs systemd-reboot.service | grep -q 
systemd-reboot.service
        if [ $? -ne 0 ]
        then
                exit 0
        fi
        mount|grep boot
               if [ $? -gt 0 ]
               then
                        echo "remounting /boot"
                        mount -v /boot
                        sleep 5
               fi
        do_stop
        ;;
  *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac
exit 0


-- debconf-show failed


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to