Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upsystemd and packaging (RPM) improvments from discussion in #213 #212
Conversation
VBart
requested a review
from
defanator
Jan 15, 2019
VBart
assigned
defanator
Jan 15, 2019
This comment has been minimized.
This comment has been minimized.
Notice that current version use an hardcoded |
remicollet
referenced this pull request
Jan 15, 2019
Closed
Updated to use systemd on Fedora's RPM #155
remicollet
changed the title
switch systemd unit type from forking to simple
systemd improvments from discussion in #213
Jan 15, 2019
remicollet
added some commits
Jan 15, 2019
remicollet
reviewed
Jan 15, 2019
@@ -1,5 +1,5 @@ | |||
# distribution specific definitions | |||
%define use_systemd (0%{?rhel} && 0%{?rhel} >= 7) || (0%{?suse_version} >= 1315) | |||
%define use_systemd 0%{?rhel} >= 7 || 0%{?fedora} >= 19 || 0%{?suse_version} >= 1315 |
This comment has been minimized.
This comment has been minimized.
remicollet
reviewed
Jan 15, 2019
[Unit] | ||
Description=NGINX Unit | ||
Wants=network-online.target | ||
After=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/sysconfig/unit | ||
Environment="UNITD_OPTIONS=--log /var/unit/unit.log --pid /run/unit.pid" |
This comment has been minimized.
This comment has been minimized.
remicollet
reviewed
Jan 15, 2019
@@ -16,9 +16,11 @@ After=network-online.target | |||
|
|||
[Service] | |||
Type=simple | |||
Environment="UNITD_OPTIONS=--log /var/log/unit/unit.log --pid /run/unit.pid" | |||
Environment="UNITD_OPTIONS=--log /var/log/unit/unit.log --pid /run/unit/unit.pid" |
This comment has been minimized.
This comment has been minimized.
remicollet
reviewed
Jan 15, 2019
@@ -1 +1 @@ | |||
UNITD_OPTIONS="--log /var/log/unit/unit.log --pid /run/unit.pid" | |||
UNITD_OPTIONS="--log /var/log/unit/unit.log --pid /var/run/unit/unit.pid" |
This comment has been minimized.
This comment has been minimized.
remicollet
Jan 15, 2019
Author
Contributor
but /var/run on non-systemd distro (where this file is used)
remicollet
reviewed
Jan 15, 2019
%dir %{_sysconfdir}/unit | ||
%if %{use_systemd} | ||
%{_unitdir}/unit.service | ||
%dir %attr(0755,root,root) %ghost %{_localstatedir}/run/unit |
This comment has been minimized.
This comment has been minimized.
remicollet
Jan 15, 2019
Author
Contributor
ghosted directory is enough, will be created during service startup by systemd
defanator
reviewed
Jan 15, 2019
%dir %{_sysconfdir}/unit | ||
%if %{use_systemd} | ||
%{_unitdir}/unit.service | ||
%else | ||
%config(noreplace) %{_sysconfdir}/sysconfig/unit |
This comment has been minimized.
This comment has been minimized.
defanator
Jan 15, 2019
Contributor
@remicollet it seems like this one is mistakenly reverted here from
575d6d4 ?
This comment has been minimized.
This comment has been minimized.
remicollet
reviewed
Jan 15, 2019
@@ -98,7 +98,7 @@ endif | |||
CONFIGURE_ARGS=\ | |||
--prefix=/usr \ | |||
--state=%{_sharedstatedir}/unit \ | |||
--control="unix:/var/run/control.unit.sock" \ | |||
--control="unix:/var/run/unit/control.sock" \ |
This comment has been minimized.
This comment has been minimized.
remicollet
Jan 15, 2019
Author
Contributor
This may raised issue when unit launch outside of systemd (e.g. in docker).
Reverted in next commit
This comment has been minimized.
This comment has been minimized.
I think everything doen, so ready for review . |
VBart
reviewed
Jan 15, 2019
@@ -98,7 +98,7 @@ endif | |||
CONFIGURE_ARGS=\ | |||
--prefix=/usr \ | |||
--state=%{_sharedstatedir}/unit \ | |||
--control="unix:/var/run/unit/control.sock" \ | |||
--control="unix:/var/run/control.unit.sock" \ |
This comment has been minimized.
This comment has been minimized.
VBart
Jan 15, 2019
•
Member
That may confuse users. Looking into unitd --help
, they will see /var/run/control.unit.sock
, while the actual path is overridden in systemd configuration. So, they will have to figure out the real path either via ps
or checking unit.service
file.
This comment has been minimized.
This comment has been minimized.
remicollet
added some commits
Jan 16, 2019
This comment has been minimized.
This comment has been minimized.
Notice: latest commit fix a issue with non-systemd packages. In pkg/rpm/rpmbuild/SOURCES/unit.init
The currently provided file is ignored, and thus needed options |
remicollet
added some commits
Jan 16, 2019
remicollet
changed the title
systemd improvments from discussion in #213
systemd and packaging (RPM) improvments from discussion in #213
Jan 17, 2019
nginx-hg-mirror
closed this
in
b78ed44
Jan 24, 2019
This comment has been minimized.
This comment has been minimized.
@remicollet committed in a single patch here: b78ed44, with a minor change to logrotate script (added check for pid file existence). Thanks! |
remicollet commentedJan 15, 2019
•
edited
forking is old deprecated mode.
simple (or even better notify, when supported) should be preferred.