It works on RHEL7 andRHEL8.
Trying to installing 8.0.2.1 version of splunk UF on "Red Hat Enterprise Linux Server release 6.10 (Santiago)".
2.6.32-754.35.1.el6.x86_64
cammand:
"{{ splunk_home }}/bin/splunk enable boot-start-user {{ splunk_user }} -systemd-managed 0 --answer-yes
--auto-ports --no-prompt --accept-license"
"stderr": "execve: No such file or directory\n while running command /sbin/chkconfig", "stderr_lines": ["execve: No such file or directory", " while running command /sbin/chkconfig"],
Hello,
Thanks for replying. Actually Gave root permission to user running enable boot from script from ansible. Same ansible user as same level of permission on RHEL7 and RHEL 8. it is working on RHEL7&8. But only in few RHEL6 to some specific servers I see. this error "execve: No such file or directory\n while running command /sbin/chkconfig", "
Both disable and enable are not working to some RHEL6 servers.
Resolution:
name: Enable splunk boot-start via initd
shell: '/usr/bin/sudo /bin/su - root -c "/opt/splunkforwarder/bin/splunk enable boot-start -user {{ splunk_user }} -systemd-managed 0 --answer-yes --auto-ports --no-prompt --accept-license"'
become: true
register: enable_bootstart changed_
when: '"Init script is configured to run at boot." in enable_bootstart.stdout'
notify:
update init.d to accept license
Reload unit files if necessary
start splunk tags: ['install']
name: "Disable boot-start"
shell: '/usr/bin/sudo /bin/su - root -c "/opt/splunkforwarder/bin/splunk disable boot-start"'
become: true
register: disable_splunk_bootstart
changed_when: '"Disabled" in disable_splunk_bootstart.stdout'
tags: ['uninstall']
I think this is a bug in how the startup script is created. Try adding the following lines to the top of /etc/init.d/splunkforwarder (or whatever the script is named):
# chkconfig: 2345 20 80
# description: splunk start up
Then run chkconfig --add splunkforwarder
That means the user you are running the command under is not root or does not have sudo privileges. chkconfig is restricted functionality.
Run it as root or a sudo user and it will be fine. However, why are you disabling systemd support? Especially on RHEL7 and 8?