Additional options for enable boot-start
The enable boot-start command supports these additional options:
Install splunk init script
In version 7.2.2 and higher, the enable boot-start command adds a -systemd-managed 0|1 option that controls whether to install the splunk init script in /etc/init.d or the Splunkd.service unit file in /etc/systemd/system.
To install the splunk init script, specify -systemd-managed 0:
$SPLUNK_HOME/bin/splunk enable boot-start -systemd-managed 0 -user <username>
Init script installed at /etc/init.d/splunk.
Init script is configured to run at boot.
-systemd-managed option, the enable boot-start command defaults to -systemd-managed 1 and installs the Splunkd.service unit file. In version 7.3.0 and later, this default behavior is reversed, and the enable boot-start command defaults to -systemd-managed 0 and installs the splunkinit file.
init.d boot-start script is not compatible with RHEL 8 and higher.
Specify a different unit file name
The default splunkd unit file name is Splunkd.service. You can specify a different name for the unit file and update the SPLUNK_SERVER_NAME value in splunk-launch.conf using the -systemd-unit-file-name option. For example, to create a unit file with the name "splunk.service":
$SPLUNK_HOME/bin/splunk enable boot-start -systemd-managed 1 -systemd-unit-file-name splunk
Systemd unit file installed at /etc/systemd/system/splunk.service.
Configured as systemd managed service.
For more information, see Unit file naming considerations.
Install polkit rules to elevate user permissions
In version 8.1.1 and higher, the enable boot-start command adds an option to install polkit rules that allow non-root users to run start, stop, and restart operations under systemd without using sudo. Installing the polkit rules can reduce overhead for admins that must otherwise add unprivileged users to the sudoers file to run these operations under systemd.
To install polkit rules:
Run the enable boot-start command, specifying the -create-polkit-rules option, as follows:
./splunk enable boot-start -systemd-managed 1 -create-polkit-rules 1 -user <username>
If you previously ran enable boot-start and specified a different user, you must change the owner of $SPLUNK_HOME to the new user for whom you create the polkit rules. For example:
chown -R <username> $SPLUNK_HOME
create-polkit-rules option, you must install the Polkit library on your system if you have not already done so.