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

nomad.service file large changes after upgrading to 0.0.4 #32

Closed
spuder opened this issue Jan 7, 2021 · 3 comments · Fixed by #41
Closed

nomad.service file large changes after upgrading to 0.0.4 #32

spuder opened this issue Jan 7, 2021 · 3 comments · Fixed by #41

Comments

@spuder
Copy link

spuder commented Jan 7, 2021

I'm running 0.0.3 (a6587bc) of this module. After upgrading to 0.0.4 I see the following changes

  • A new file is created /etc/systemd/system/nomad.service however the old systemd file is not removed from /lib/systemd/system/nomad.service
  • The new systemd file is missing some of the same primitives

0.0.4

cat /etc/systemd/system/nomad.service
[Unit]
Description=Nomad agent
Documentation=https://nomadproject.io/docs/
Wants=network-online.target
After=network-online.target
StartLimitBurst=3
StartLimitIntervalSec=10

[Service]
EnvironmentFile=-/etc/sysconfig/nomad
Restart=on-failure
ExecStart=/usr/local/bin/nomad agent -config=/etc/nomad
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
RestartSec=2
LimitNOFILE=65536
LimitNPROC=infinity
KillMode=process
TasksMax=infinity

[Install]
WantedBy=multi-user.target

0.0.3

cat /lib/systemd/system/nomad.service
[Unit]
Description=Nomad agent
Requires=network-online.target consul.service
After=network-online.target consul.service

[Service]
EnvironmentFile=-/etc/sysconfig/nomad
Restart=on-failure
ExecStart=/usr/local/bin/nomad agent -config=/etc/nomad
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
RestartSec=42s
LimitNOFILE=131072

[Install]
WantedBy=multi-user.target

This is a pretty large change for a point release

@kenyon
Copy link
Member

kenyon commented Jan 8, 2021

Leaving obsolete files around is not great (this is one reason why package management systems are a thing), but at least the file in /etc should be fully overriding the one in /lib. There never should have been a service file in /lib because that's where packages are supposed to install them, and nomad is not even packaged by HashiCorp, looks like they just release a single binary. #13 did this.

The template is based on the upstream file (and needs to be updated again), so it's not really missing anything, it's just following upstream: https://github.com/hashicorp/nomad/blob/master/dist/systemd/nomad.service

Yes, probably after four years of changes since the last release, the version bump should have been bigger.

@ekohl
Copy link
Member

ekohl commented Jan 8, 2021

I did suggest a 0.1.0 version so I'm surprised it was released as 0.4.0.

@attachmentgenie
Copy link
Member

@spuder @ekohl I am happy to push this as another release version, but my lack of bump was more about being able to get a release out ASAP. I ll add some code to remove the old file.

On my list of things to do is definitely getting the template in sync with the upstream version.

@spuder this line was never in the 0.0.3 module release btw => After=network-online.target consul.service

@kenyon hashicorp has recently started properly packaging so that is one of the things i am planning to add to this module too (and perhaps the consul and vault modules)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants