02202aa70f
Sourcing logger file in kdump-lib.sh will leak kdump helper to dracut, because module-setup.sh will source kdump-lib.sh. This will make kdump's function override dracut's ones, and lead to unexpected behaviours. So include kdump-logger.sh individually and only source it where it really needed. for module-setup.sh, simply use dracut's logger helper is good enough so just source kdump-logger.sh in kdump only scripts. Signed-off-by: Kairui Song <kasong@redhat.com> Acked-by: Lianbo Jiang <lijiang@redhat.com>
24 lines
537 B
Bash
24 lines
537 B
Bash
#!/bin/sh
|
|
|
|
# More details about systemd generator:
|
|
# http://www.freedesktop.org/wiki/Software/systemd/Generators/
|
|
|
|
. /usr/lib/kdump/kdump-lib.sh
|
|
. /usr/lib/kdump/kdump-logger.sh
|
|
|
|
# If invokded with no arguments for testing purpose, output to /tmp to
|
|
# avoid overriding the existing.
|
|
dest_dir="/tmp"
|
|
|
|
if [ -n "$1" ]; then
|
|
dest_dir=$1
|
|
fi
|
|
|
|
systemd_dir=/usr/lib/systemd/system
|
|
kdump_wants=$dest_dir/kdump.service.wants
|
|
|
|
if is_ssh_dump_target; then
|
|
mkdir -p $kdump_wants
|
|
ln -sf $systemd_dir/network-online.target $kdump_wants/
|
|
fi
|