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

V38581: Failed to create the hardlink for /boot/grub.conf #47

Closed
lorengordon opened this issue Feb 11, 2015 · 3 comments
Closed

V38581: Failed to create the hardlink for /boot/grub.conf #47

lorengordon opened this issue Feb 11, 2015 · 3 comments

Comments

@lorengordon
Copy link
Member

Having trouble following the logic in the sls, need to study it more.

          ID: file_V38581-hardlink
    Function: module.run
        Name: file.link
      Result: False
     Comment: Module function file.link threw an exception. Exception: Could not create '/boot/grub.conf'
     Started: 22:00:46.027891
    Duration: 0.881 ms
     Changes:   
@ferricoxide
Copy link
Member

In general, /boot/grub.conf should always exist (GRUB generally won't boot the system without it since its contents tell GRUB where to find the subsequent parts of the boot-time chain-load of the OS). This handler is in place mostly to ensure that the other (mostly redundant) pointers to the cardinal grub.conf are also present. My assumption on the "could not create" is that Salt is ungracefully complaining that the target already exists (stuff run from 'module.run' seem to have less-graceful handling of such "already-exists" types of scenarios).

@lorengordon
Copy link
Member Author

There's some kind of conflict in the handling of /boot/grub.conf. It seems the end result is desired for it to be a hard link to /boot/grub/grub.conf. On the centos build, that's how it starts out, as well. But after running the ash-linux states, it's a hard link to /boot/grub/grub.conf.bak. /boot/grub/grub.conf is actually a different file. I'm guessing the conflict is in one of the other states using file.replace on /boot/grub/grub.conf...

@lorengordon
Copy link
Member Author

Ok, I figured out the logic and inter-play between V38579, V38581, and V38583 that was causing the error where it could not create the hard link. I've resolved that with an unless test that executes at run-time rather than render-time. I'm going to create a new issue to track the conflict with file.replace where the hard link ends up pointing to the wrong file.

file_V{{ stig_id }}-hardlink:
  module.run:
    - name: 'file.link'
    - src: '/boot/grub/grub.conf'
    - path: '/boot/grub.conf'
    - unless: 'test -e /boot/grub.conf'

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

2 participants