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

Enforce exec should find sysctl, test from path #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jameslikeslinux
Copy link

On Gentoo, sysctl is in /usr/sbin, not /sbin, resulting in an error like:

Error: Could not find command '/sbin/sysctl'
Error: /Stage[main]/Sysctl[vm.min_free_kbytes]/Exec[enforce-sysctl-value-vm.min_free_kbytes]/returns: change from notrun

Other execs in this defined type use the path to find sysctl, so the enforce exec should as well.

This also fixes the indentation of the block to be consistent with the rest of the file.

On Gentoo, sysctl is in `/usr/sbin`, not `/sbin`, resulting in an error
like:

```
Error: Could not find command '/sbin/sysctl'
Error: /Stage[main]/Sysctl[vm.min_free_kbytes]/Exec[enforce-sysctl-value-vm.min_free_kbytes]/returns: change from notrun
```

Other `exec`s in this defined type use the path to find `sysctl`, so
the enforce `exec` should as well.
@tobiaspal
Copy link

Until this is merged I did a workaround:

class gentoo_base::puppet_sysctl_path_workaround {
  # This is to work around https://github.com/thias/puppet-sysctl/pull/43 until it's merged
  file { '/sbin/sysctl':
    ensure => link,
    target => '/usr/sbin/sysctl',
    replace => false,
  } ->
  Class['sysctl::base']
  # To remove it later
  # exec { 'rm /sbin/sysctl':
  #   onlyif => 'test -L /sbin/sysctl',
  # }
}

Can we merge it please?

@ntnn
Copy link

ntnn commented Jan 31, 2017

Encountered this one as well. A merge would be nice.

@saz
Copy link

saz commented Jun 29, 2017

This fix is working and can be merged 👍

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

Successfully merging this pull request may close these issues.

4 participants