Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal that alternate path should auto create the path in the filesystem. #8

Open
tabowling opened this issue May 6, 2017 · 0 comments

Comments

@tabowling
Copy link
Contributor

tabowling commented May 6, 2017

When testing "path: /var/mytest/crash" as an alternate dump location, kdump fails to restart because the path does not exist. However, the value is written to the /etc/kdump.conf file.

I propose that when specifying an alternate path, we attempt to create that alternate with same permissions and SELinux context as /var/crash.

If we cannot properly establish the path, then we should fail and not write the value to the new kdump.config file.

Playbook output

TASK [linux-system-roles.kdump : Generate /etc/kdump.conf] ***********************************************************************************
task path: /etc/ansible/roles/linux-system-roles.kdump/tasks/main.yml:11
NOTIFIED HANDLER restart kdump
changed: [rhel7-latest] => {"backup_file": "/etc/kdump.conf.2685.2017-05-06@08:19:24~", "changed": true, "checksum": "65e4cd35d517dcb3b66171cf0b5e102dbc8dfab2", "dest": "/etc/kdump.conf", "gid": 0, "group": "root", "md5sum": "e51517147da1f4d016a19f04b93db815", "mode": "0644", "owner": "root", "size": 149, "src": "/root/.ansible/tmp/ansible-tmp-1494073163.48-101588653438446/source", "state": "file", "uid": 0}

TASK [linux-system-roles.kdump : Generate /etc/sysconfig/kdump] ******************************************************************************
task path: /etc/ansible/roles/linux-system-roles.kdump/tasks/main.yml:19
changed: [rhel7-latest] => {"backup_file": "/etc/sysconfig/kdump.2786.2017-05-06@08:19:24~", "changed": true, "checksum": "7c35057f663ca5165c0f7e266df635334d0356a3", "dest": "/etc/sysconfig/kdump", "gid": 0, "group": "root", "md5sum": "194138297db4b4029fd41ec574735520", "mode": "0644", "owner": "root", "size": 410, "src": "/root/.ansible/tmp/ansible-tmp-1494073164.11-88997200875910/source", "state": "file", "uid": 0}

RUNNING HANDLER [linux-system-roles.kdump : restart kdump] ***********************************************************************************
fatal: [rhel7-latest]: FAILED! => {"changed": false, "failed": true, "msg": "Unable to restart service kdump: Job for kdump.service failed because the control process exited with error code. See \"systemctl status kdump.service\" and \"journalctl -xe\" for details.\n"}
META: ran handlers
	to retry, use: --limit @/home/tbowling/src/virt-demo/ansible/example-linux-system-roles.kdump.retry

PLAY RECAP ***********************************************************************************************************************************
rhel7-latest               : ok=5    changed=3    unreachable=0    failed=1   

journald output

-- Unit kdump.service has begun starting up.
May 06 08:19:24 rhel7-latest kdumpctl[2856]: Detected change(s) in the following file(s):
May 06 08:19:24 rhel7-latest kdumpctl[2856]: /etc/kdump.conf
May 06 08:19:24 rhel7-latest kdumpctl[2856]: Rebuilding /boot/initramfs-3.10.0-514.el7.x86_64kdump.img
May 06 08:19:25 rhel7-latest kdumpctl[2856]: Dump path /var/mytest/crash does not exist.
May 06 08:19:25 rhel7-latest systemd[1]: kdump.service: main process exited, code=exited, status=1/FAILURE
May 06 08:19:25 rhel7-latest kdumpctl[2856]: mkdumprd: failed to make kdump initrd
May 06 08:19:25 rhel7-latest kdumpctl[2856]: Starting kdump: [FAILED]
May 06 08:19:25 rhel7-latest systemd[1]: Failed to start Crash recovery kernel arming.
-- Subject: Unit kdump.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit kdump.service has failed.

File permissions to clone from /var/crash. Note: we may want to use our new selinux module to set the context.

[root@rhel7-latest ~]# ls -ld /var/crash/
drwxr-xr-x. 2 root root 6 Sep  5  2016 /var/crash/

[root@rhel7-latest ~]# ls -lZd /var/crash/
drwxr-xr-x. root root system_u:object_r:kdump_crash_t:s0 /var/crash/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant