LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-14-2015, 10:49 AM   #1
mydogspot
LQ Newbie
 
Registered: Nov 2009
Posts: 11

Rep: Reputation: 0
starting splunk service on RHEL7


I'm trying to write a puppet module that will install and start splunk on a new rhel7 server - I'm still really new to rhel7. Our older splunk servers had /etc/init.d/splunk to start splunk but the rhel7 server wants to use systemd. So it looks like I need to figure out how to start splunk as a service. Can anyone point me to documentation on how to do this? This is the error message -
Error: Could not start Service[splunk]: Execution of '/bin/systemctl start splunk' returned 6: Failed to issue method call: Unit splunk.service failed to load: No such file or directory.

In puppet I just told it to ensure that splunk was running. I could force it to use init.d but I would rather do it the right way.
 
Old 07-16-2015, 12:07 AM   #2
Aia
Member
 
Registered: Jun 2006
Posts: 66

Rep: Reputation: 21
Quote:
Create systemd service /usr/lib/systemd/system/splunk.service:

[Unit]
Description=Splunk
After=network.target

[Service]
RemainAfterExit=yes
ExecStart=/opt/splunk/bin/splunk start
ExecStop=/opt/splunk/bin/splunk stop
ExecReload=/opt/splunk/bin/splunk restart
User=splunk
Group=splunk

[Install]
WantedBy=multi-user.target
Quote:
systemctl enable splunk
Got it from here: http://wiki.polaire.nl/doku.php?id=splunk_centos7
 
Old 07-16-2015, 04:17 PM   #3
redhat_redneck
LQ Newbie
 
Registered: Jul 2013
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by mydogspot View Post
I'm trying to write a puppet module that will install and start splunk on a new rhel7 server - I'm still really new to rhel7. Our older splunk servers had /etc/init.d/splunk to start splunk but the rhel7 server wants to use systemd. So it looks like I need to figure out how to start splunk as a service. Can anyone point me to documentation on how to do this? This is the error message -
Error: Could not start Service[splunk]: Execution of '/bin/systemctl start splunk' returned 6: Failed to issue method call: Unit splunk.service failed to load: No such file or directory.

In puppet I just told it to ensure that splunk was running. I could force it to use init.d but I would rather do it the right way.
If you want to have it start as a particular user you can also run:
$SPLUNKHOME/bin/splunk enable boot-start -user <user_name to start under>.
Example: if you would want to start Splunk as user splunk_ninja:
/opt/splunk/bin/splunk enable boot-start -user splunk_ninja

Also when starting for the first time after an install you can do:
/opt/splunk/bin/splunk start --accept-license so the license screen doesn't interrupt the startup.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to install RHEL7 KVM onto RHEL7 desktop redhatprat Red Hat 10 02-18-2015 04:44 AM
Kernel error - Error in starting splunk forwarder in linux machine sumanth89 Linux - Newbie 1 03-19-2013 10:49 AM
Won't Boot - Starting Printer Service - Starting CUPS jeansond Linux - Newbie 0 10-11-2004 07:39 PM
starting one service before the other in Rh jayakrishnan Linux - General 2 11-19-2003 01:32 AM
starting up a service Robin01 Linux - Newbie 3 08-31-2003 06:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration