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
Use the recommended systemd config #129
Conversation
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, other than removing the log
directory.
User=_rmt | ||
PrivateTmp=yes | ||
Environment=RAILS_LOG_TO_STDOUT=1 |
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, but I'd suggest making changes to the RPM package as well -- currently it creates an empty log
directory to store file logs. It can be dropped now.
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.
Does 923488d look good?
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.
Yep! 👍
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.
Cool. I can't merge until we merge the parser
gem fix xD
Puma specifies a recommended way of starting it with systemd at: https://github.com/puma/puma/blob/5fb2df9144803f0f80ec1d9fb19d20d433706fef/docs/systemd.md#service-configuration Type=simple can be used, and then there's not need to --daemon the Rails server. Additionally, we set the RAILS_LOG_TO_STDOUT variable, so that Rails outputs its log to stdout. This allows for the logs to be saved and visible in journalctl. The PrivateTmp option "sets up a new file system namespace for the executed processes and mounts private /tmp and /var/tmp directories inside it that is not shared by processes outside of the namespace. (...) all temporary files created by a service in these directories will be removed after the service is stopped." Since RMT creates some temporary directories while mirroring, with this option we isolate them and make sure they get deleted when RMT is stopped. Closes #128.
Since the logs are stored by journalctl, that directory is no longer necessary.
923488d
to
d491827
Compare
Puma specifies a recommended way of starting it with systemd at:
https://github.com/puma/puma/blob/5fb2df9144803f0f80ec1d9fb19d20d433706fef/docs/systemd.md#service-configuration
Type=simple can be used, and then there's not need to --daemon the Rails
server.
Additionally, we set the RAILS_LOG_TO_STDOUT variable, so that Rails
outputs its log to stdout. This allows for the logs to be saved and
visible in journalctl.
The PrivateTmp option "sets up a new file system namespace for the
executed processes and mounts private /tmp and /var/tmp directories
inside it that is not shared by processes outside of the namespace.
(...) all temporary files created by a service in these directories will
be removed after the service is stopped."
Since RMT creates some temporary directories while mirroring, with this
option we isolate them and make sure they get deleted when RMT is
stopped.