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

Unable to create symlink #212

Closed
nikitashalnov opened this issue Jan 17, 2019 · 3 comments · Fixed by #215
Closed

Unable to create symlink #212

nikitashalnov opened this issue Jan 17, 2019 · 3 comments · Fixed by #215

Comments

@nikitashalnov
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 1.10.14-1stretch (for example)
  • Distribution: Debian 9
  • Module version: 7.3.0

Description

Splunk versions above 7.2.1 don't create file /etc/init.d/splunk during the command splunk enable boot-start -user ${splunk_user}. It creates symlink on systemd unit (service):

ls -l /etc/systemd/system/multi-user.target.wants/SplunkForwarder.service 
lrwxrwxrwx 1 root root 43 Jan 16 13:30 /etc/systemd/system/multi-user.target.wants/SplunkForwarder.service -> /etc/systemd/system/SplunkForwarder.service

But in manifests/platform/posix.pp execs expect that file /etc/init.d/splunk is created. So on every run of puppet agent, agent tries to create this symlink and gets an error:

Notice: /Stage[main]/Splunk::Platform::Posix/Exec[enable_splunkforwarder]/returns: Unable to create symlink='/etc/systemd/system/multi-user.target.wants/SplunkForwarder.service'
Notice: /Stage[main]/Splunk::Platform::Posix/Exec[enable_splunkforwarder]/returns: : File exists
Error: '/opt/splunkforwarder/bin/splunk enable boot-start -user root' returned 8 instead of one of [0]
Error: /Stage[main]/Splunk::Platform::Posix/Exec[enable_splunkforwarder]/returns: change from notrun to 0 failed: '/opt/splunkforwarder/bin/splunk enable boot-start -user root' returned 8 instead of one of [0]

I commited some changes to my fork, but not sure that this is the proper way to fix this problem.

@bastelfreak
Copy link
Member

Hi @nikitashalnov, could you open up a PR with your change?

@el-mango-cosmico
Copy link

hi @nikitashalnov any update on when this could be completed? we are wanting to run 7.2.3 but aren't able to because of this issue.

Thanks

@mwhitake
Copy link

I ran into the same problem. I was able to fix that by adding a variable and checking for the presence of the systemd start script on EL7 hosts.
However, once I had that issue resolved, it revealed a different issue. The splunk boot-enable command creates the systemd start scripts with mixed case names, and gives the forwarder service the name SplunkForwarder and the puppet module expects to just start the service 'splunk' regardless of whether it is a forwarder or the server.

alexjfisher pushed a commit to alexjfisher/puppet-splunk that referenced this issue Apr 5, 2019
* Supports systemd boot-start
* Changed module design from Class[splunk], Class[splunk::forwarder] to
  Class[splunk::enterprise] and Class[splunk::forwarder]
* Removed legacy-style service management
* Allow users to disable default config (splunk/forwarder_* types)
* Removed ability to include enterprise and forwarder on the same machine
  * Forwarder is simply a subset of enterprise capability and there is no need
    to have both
  * Forwarder and enterprise potentially share common service names and other
    assets, which cause issues when including both
* Bumped dependency on stdlib to 4.25.0 to ensure strong typing support
* Allow users to specify splunk service user
* Added password management to enterprise

Fixes voxpupuli#213
Fixes voxpupuli#212
Fixes voxpupuli#210
alexjfisher pushed a commit to alexjfisher/puppet-splunk that referenced this issue Apr 5, 2019
* Default splunk version to 7.2.4.2
* Supports systemd boot-start
  * sysvinit file ensured absent on systemd machines when supported
  * net-tools ensured present on enterprise nodes splunk >= 7.2.4.2
  * Removed legacy-style service management
* Changed module design from Class[splunk], Class[splunk::forwarder] to
  Class[splunk::enterprise] and Class[splunk::forwarder]
  * Removed inclusion of the ::archive class
  * Cleaned up install logic
* Allow users to disable default config (splunk/forwarder_* types)
  * Generate splunkforwarder_input/output with iteration, instead of
    create_resources
* Removed ability to include enterprise and forwarder on the same machine
  * Forwarder and enterprise potentially share common service names and other
    assets, which cause issues when including both
  * Forwarder is simply a subset of enterprise capability and there is no need
    to have both
* Bumped dependency on stdlib to 4.25.0 to ensure strong typing support
* Allow users to specify splunk service user
* Added password management to enterprise

Fixes voxpupuli#213
Fixes voxpupuli#212
Fixes voxpupuli#210
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 a pull request may close this issue.

4 participants