Backport of Move systemd unit file rate limits from [Service] to [Unit] block into release/1.6.x #19103

Co-authored-by: Adrian Todorov <adrian.todorov@hashicorp.com>
This commit is contained in:
hc-github-team-nomad-core 2023-11-16 07:41:47 -06:00 committed by GitHub
parent 70f69fc9e6
commit fd4ba6ebb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,17 +10,6 @@ After=network-online.target
#Wants=consul.service #Wants=consul.service
#After=consul.service #After=consul.service
[Service]
EnvironmentFile=-/etc/nomad.d/nomad.env
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/bin/nomad agent -config /etc/nomad.d
KillMode=process
KillSignal=SIGINT
LimitNOFILE=65536
LimitNPROC=infinity
Restart=on-failure
RestartSec=2
## Configure unit start rate limiting. Units which are started more than ## Configure unit start rate limiting. Units which are started more than
## *burst* times within an *interval* time span are not permitted to start any ## *burst* times within an *interval* time span are not permitted to start any
## more. Use `StartLimitIntervalSec` or `StartLimitInterval` (depending on ## more. Use `StartLimitIntervalSec` or `StartLimitInterval` (depending on
@ -36,6 +25,17 @@ RestartSec=2
## StartLimitInterval is used for systemd versions < 230 ## StartLimitInterval is used for systemd versions < 230
# StartLimitInterval = 10s # StartLimitInterval = 10s
[Service]
EnvironmentFile=-/etc/nomad.d/nomad.env
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/bin/nomad agent -config /etc/nomad.d
KillMode=process
KillSignal=SIGINT
LimitNOFILE=65536
LimitNPROC=infinity
Restart=on-failure
RestartSec=2
TasksMax=infinity TasksMax=infinity
OOMScoreAdjust=-1000 OOMScoreAdjust=-1000