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

Issue : Current Systemd implementation may not support workload management per Splunk Docs Systemd configuration #55

Closed
lmnogues opened this issue Mar 18, 2021 · 2 comments · Fixed by #71
Assignees
Labels
bug Something isn't working

Comments

@lmnogues
Copy link
Contributor

lmnogues commented Mar 18, 2021

Configuration of the systemd Splunkd.service is using the following values :

    - { option: "ExecStart", value: "{{ splunk_home }}/bin/splunk start --accept-license --answer-yes --no-prompt" }
    - { option: "ExecStop", value: "{{ splunk_home }}/bin/splunk start stop" }
    - { option: "ExecReload", value: "{{ splunk_home }}/bin/splunk restart" }
    - { option: "Restart", value: "on-failure" }
    - { option: "RestartSec", value: "30s" }
    - { option: "TimeoutStopSec", value: "10min" }
    - { option: "Type", value: "forking" }
    - { option: "RemainAfterExit", value: "False" }
    - { option: "User", value: "{{ splunk_nix_user }}" }
    - { option: "Group", value: "{{ splunk_nix_group }}" }
    - { option: "PIDFile", value: "{{ splunk_home }}/var/run/splunk/splunkd.pid" }
    - { option: "LimitNOFILE", value: "1024000" }
    - { option: "LimitNPROC", value: "512000" }
    - { option: "LimitFSIZE", value: "infinity" }
    - { option: "LimitDATA", value: "infinity" }
    - { option: "LimitCORE", value: "infinity" }
    - { option: "TasksMax", value: "infinity" }

when the splunk documentation is asking for :

#This unit file replaces the traditional start-up script for systemd
#configurations, and is used when enabling boot-start for Splunk on
#systemd-based Linux distributions.

[Unit]
Description=Systemd service file for Splunk, generated by 'splunk enable boot-start'
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/opt/splunk/bin/splunk _internal_launch_under_systemd
KillMode=mixed
KillSignal=SIGINT
TimeoutStopSec=360
LimitNOFILE=65536
SuccessExitStatus=51 52
RestartPreventExitStatus=51
RestartForceExitStatus=52
User=splunker
Group=splunker
Delegate=true
CPUShares=1024
MemoryLimit=<value>
PermissionsStartOnly=true
ExecStartPost=/bin/bash -c "chown -R splunker:splunker /sys/fs/cgroup/cpu/system.slice/%n"
ExecStartPost=/bin/bash -c "chown -R splunker:splunker /sys/fs/cgroup/memory/system.slice/%n"

[Install]
WantedBy=multi-user.target

The current configuration does not allow for the Workload management to be enabled via an ansible installation (at least the ExecStart and the Restart need to be changed.

I'm not a Unix expert so I don't really know the impact of this.

@mason-splunk mason-splunk self-assigned this Mar 22, 2021
@mason-splunk
Copy link
Contributor

mason-splunk commented Mar 22, 2021

Good catch. I came across this in the docs as well, but only after the refactor to rely on service restarts for everything was done. I have not tested with workload management to confirm that the current configuration does not work with it, but I agree that we generally should be aligned with the best practices from the docs.

This is going to require some additional refactoring, as ExecStart=/opt/splunk/bin/splunk _internal_launch_under_systemd does not accept additional arguments, namely --accept-license which means we'll need to make a new task that does splunk ftr --accept-licence --no-prompt --answer-yes and include it at the appropriate points (ie after install/upgrade but before starting splunk) during the installation and upgrade tasks.

@mason-splunk mason-splunk changed the title Issue : Systemd configuration does not reflect Splunk Configuration Issue : Systemd configuration does not reflect Splunk Docs Systemd Configuration Mar 22, 2021
@mason-splunk mason-splunk added the bug Something isn't working label Mar 22, 2021
@mason-splunk mason-splunk changed the title Issue : Systemd configuration does not reflect Splunk Docs Systemd Configuration Issue : Current Systemd implementation may not support workload management per Splunk Docs Systemd configuration Mar 22, 2021
@mason-splunk
Copy link
Contributor

Need to refactor to comply with the docs guidance: https://docs.splunk.com/Documentation/Splunk/8.1.3/Admin/RunSplunkassystemdservice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants