Commit Graph

13 Commits

Author SHA1 Message Date
Kairui Song
da6b280a63 Cleanup dead systemd services before start sysroot.mount
Resolves: bz1972463
Conflict: None
Upstream: Fedora

commit 2603ba7187 (origin/rawhide, rawhide)
Author: Kairui Song <kasong@redhat.com>
Date:   Fri Jul 2 03:27:05 2021 +0800

    Cleanup dead systemd services before start sysroot.mount

    When kdump failed due to initqueue timeout, the sysroot.mount and other
    serivces could be stuck in `start` but `dead` status:

    Example output of systemctl:

    dev-disk-by\x2duuid-530830d1\x2df2c7\x2d4c9a\x2d9a82\x2d148609097521.device loaded inactive   dead    start
    <... snip ...>
    squash-root.mount               loaded active     mounted       /squash/root
    squash.mount                    loaded active     mounted       /squash
    sysroot.mount                   loaded inactive   dead    start /sysroot
    <... snip ...>
    dracut-cmdline.service          loaded active     exited        dracut cmdline hook
    dracut-initqueue.service        loaded activating start   start dracut initqueue hook
    dracut-mount.service            loaded inactive   dead    start dracut mount hook

    At this point calling `systemctl start sysroot.mount` will just hang as
    systemd will just wait for the services that are stuck in `start`
    status. So call `systemctl cancel` here to cancel all pending jobs and
    have a clean start for mounting sysroot.

    Signed-off-by: Kairui Song <kasong@redhat.com>
    Acked-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-07-20 07:12:55 +00:00
Kairui Song
50d77e1989 Use a customized emergency shell
Resolves: bz1901024
Upstream: Fedora
Conflict: None

commit 41980f30d9
Author: Kairui Song <kasong@redhat.com>
Date:   Mon Apr 26 17:09:57 2021 +0800

    Use a customized emergency shell

    Use a modified and minimized version of emergency shell.
    The differences of this kdump shell and dracut emergency shell are:

      - Kdump shell won't generate a rdsosreport automatically
      - Customized prompts
      - Never ask root password
      - Won't tangle with dracut's emergency_action. If emergency_action is
        set, dracut emergency shell will perform dracut's emergency_action
        instead of kdump final_action on exit.
      - If rd.shell=no is set, kdump shell will still work, dracut emergency
        shell won't, even if kdump failure_action is set to shell.

    Signed-off-by: Kairui Song <kasong@redhat.com>
    Acked-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-04 14:30:45 +08:00
Kairui Song
e5ccb87ef6 Don's try to restart dracut-initqueue if it's already there
Resolves: bz1901024
Upstream: Fedora
Conflict: None

commit 108258139a
Author: Kairui Song <kasong@redhat.com>
Date:   Mon Apr 26 17:09:55 2021 +0800

    Don's try to restart dracut-initqueue if it's already there

    kdump's dump_to_rootfs will try to start initqueue unconditionally.
    dump_to_rootfs will run after systemd isolate to emergency
    target, so this is currently accetable.

    But there is a problem when initqueue starts the emergency action
    because of initqueue timeout. dump_to_rootfs will start initqueue and
    lead to timeout again.

    So following patch will remove the previous isolation wrapper, and
    detect the service status here. Previous isolation makes the detection
    impossible. Now this detection will be valid and helpful to prevent
    double timeout or hang.

    Signed-off-by: Kairui Song <kasong@redhat.com>
    Acked-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-04 14:27:58 +08:00
Tao Liu
41f1d5b2e9 fadump: fix dump capture failure to root disk
Resolves: bz1952652
Upstream: fedora
Conflict: none

commit d0e9c51e0d
Author: Hari Bathini <hbathini@linux.ibm.com>
Date:   Thu Apr 22 18:21:59 2021 +0530

    fadump: fix dump capture failure to root disk

    If the dump target is the root disk, kdump scripts add an entry in
    /etc/fstab for root disk with /sysroot as the mount point. The root
    disk, passed through root=<> kernel commandline parameter, is mounted
    at /sysroot in read-only mode before switching from initial ramdisk.
    So, in fadump mode, a remount of /sysroot to read-write mode is needed
    to capture dump successfully, because /sysroot is already mounted as
    read-only based on root=<> boot parameter.

    Commit e8ef4db8ff ("Fix dump_fs mount point detection and fallback
    mount") removed initialization of $_op variable, the variable holding
    the options the dump target was mounted with, leading to the below
    error as remount was skipped:

      kdump[586]: saving to /sysroot/var/crash/127.0.0.1-2021-04-22-07:22:08/
      kdump.sh[587]: mkdir: cannot create directory '/sysroot/var/crash/127.0.0.1-2021-04-22-07:22:08/': Read-only file system
      kdump[589]: saving vmcore failed

    Restore $_op variable initialization in dump_fs() function to fix this.

    Fixes: e8ef4db8ff ("Fix dump_fs mount point detection and fallback mount")
    Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
    Acked-by: Kairui Song <kasong@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
2021-05-14 14:27:03 +08:00
Tao Liu
134a7686ed Fix incorrect file permissions of vmcore-dmesg-incomplete.txt
Resolves: bz1955453
Upstream: fedora
Conflict: none

commit ca05b754af
Author: Tao Liu <ltao@redhat.com>
Date:   Mon May 10 22:10:26 2021 +0800

    Fix incorrect file permissions of vmcore-dmesg-incomplete.txt

    vmcore-dmesg-incomplete.txt is generated by shell redirection,
    which taking the default umask value. When dmesg collector exits
    with non-zero, the file will exist and anyone can have access to
    it.

    This patch fixed the issue by chmod the file, making it accessible
    only to its owner.

    Signed-off-by: Tao Liu <ltao@redhat.com>
    Acked-by: Kairui Song <kasong@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
2021-05-14 14:27:03 +08:00
Tao Liu
3371584d02 Fix incorrect permissions on kdump dmesg file
Resolves: rhbz#1938165
Upstream: fedora
Conflict: none

commit 91c802ff52
Author: Tao Liu <ltao@redhat.com>
Date:   Thu Mar 18 16:52:46 2021 +0800

    Fix incorrect permissions on kdump dmesg file

    Also known as CVE-2021-20269. The kdump dmesg log files(kexec-dmesg.log,
    vmcore-dmesg.txt) are generated by shell redirection, which take the
    default umask value, making the files readable for group and others.

    This patch chmod these files, making them only accessible to owner.

    Signed-off-by: Tao Liu <ltao@redhat.com>
    Acked-by: Kairui Song <kasong@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
2021-04-20 16:29:24 +08:00
DistroBaker
624a6443ca Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/kexec-tools.git#33108ef524ff033295711f888ce2c67d457951aa
2021-01-22 08:12:00 +00:00
DistroBaker
6333173003 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/kexec-tools.git#fc703518525dc85b88873120f2bcf7bffa682735
2021-01-08 13:46:38 +00:00
DistroBaker
7d0122bd5d Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/kexec-tools.git#7cb4be80cdaaf85b7dcbdf8f15b113192159026b
2020-12-23 10:00:07 +00:00
DistroBaker
a1014067b4 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/kexec-tools.git#d5e39c9f7b721b80d2aa1afa85c38754a5be074e
2020-11-30 11:50:38 +00:00
DistroBaker
17a51515f0 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/kexec-tools.git#4f492cf73ea11ff74f5b062e18fcea45cb5e7eeb
2020-11-20 12:35:49 +00:00
DistroBaker
5cac7c3f96 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/kexec-tools.git#bfd06661e81465d077bac435c90b4082134adf19
2020-11-05 05:34:29 +00:00
Petr Šabata
f5bf4978d8 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/kexec-tools#041ba89902961b5490a7143d9596dc00d732cba0
2020-10-15 14:45:57 +02:00