-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ADDED] Systemd unit file #587
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
Conversation
Can an exclusion be added to not cover this file? |
@RedShift1 , thank you for the PR! I can see this having dependencies on the .rpm/.deb installations. Let's keep this open until those are created. |
Well here's the thing. If I add the RPM spec file before the systemd unit file, I have to reference (in the spec file) the unit file that's outside the source. So in order to successfully build the RPM, you'd need the specfile, the systemd unit file and the source tar. When the unit file is added to the source afterwards, I would have to change the spec file to reference the unit file that ships with the source tar. If we add the systemd unit file to the source before we add the spec file, then I can immediately reference the unit file from the source in the spec file. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Only recommendation is to add Reload and Stop commands. Once you've updated, I'll test and confirm.
util/gnatsd.service
Outdated
PrivateTmp=true | ||
Type=simple | ||
PIDFile=/var/run/gnatsd/%i.pid | ||
ExecStart=/usr/sbin/gnatsd -c /etc/gnatsd.conf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend adding the following commands for standard reload and stop behavior:
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure the QUIT signal is the right signal to terminate gnatsd correctly? Because gnatsd spams the logs when you send it the QUIT sig: https://pastebin.com/9D4R40b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SIGINT would probably be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other like TERM would not allow server to cleanly shutdown (which may be OK as a standalone process).
Removes PIDFile (gnatsd doesn't create a pid file) and implements the Reload and Stop service commands
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Changes proposed in this pull request:
/cc @nats-io/core