Packages: added systemd service for debug binary.
This commit is contained in:
@@ -99,7 +99,8 @@ install: build do.tests
|
|||||||
dh_testroot
|
dh_testroot
|
||||||
dh_prep
|
dh_prep
|
||||||
dh_installdirs
|
dh_installdirs
|
||||||
dh_installsystemd
|
dh_installsystemd -punit --name=unit unit.service
|
||||||
|
dh_installsystemd -punit --name=unit-debug --no-start --no-enable unit-debug.service
|
||||||
dh_installlogrotate
|
dh_installlogrotate
|
||||||
cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR) make install
|
cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR) make install
|
||||||
cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR_dev) make libunit-install
|
cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR_dev) make libunit-install
|
||||||
|
|||||||
14
pkg/deb/debian/unit-debug.service
Normal file
14
pkg/deb/debian/unit-debug.service
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=NGINX Unit
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
PIDFile=/var/run/unit.pid
|
||||||
|
EnvironmentFile=-/etc/default/unit
|
||||||
|
ExecStart=/usr/sbin/unitd-debug $DAEMON_ARGS
|
||||||
|
ExecReload=
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
26
pkg/rpm/rpmbuild/SOURCES/unit-debug.service
Normal file
26
pkg/rpm/rpmbuild/SOURCES/unit-debug.service
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Modifying this file in-place is not recommended, because changes
|
||||||
|
# will be overwritten during package upgrades. To customize the
|
||||||
|
# behaviour, run "systemctl edit unit-debug" to create an override unit.
|
||||||
|
|
||||||
|
# For example, to change options given to the unitd binary at startup,
|
||||||
|
# create an override unit (as is done by systemctl edit) and enter
|
||||||
|
# the following:
|
||||||
|
|
||||||
|
# [Service]
|
||||||
|
# Environment="UNITD_OPTIONS=--log /var/log/unit/unit.log --pid /var/run/unit/unit.pid"
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=NGINX Unit
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Environment="UNITD_OPTIONS=--log /var/log/unit/unit.log --pid /var/run/unit/unit.pid"
|
||||||
|
ExecStart=/usr/sbin/unitd-debug $UNITD_OPTIONS --no-daemon
|
||||||
|
ExecReload=
|
||||||
|
RuntimeDirectory=unit
|
||||||
|
RuntimeDirectoryMode=0755
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -39,8 +39,9 @@ Group: System Environment/Daemons
|
|||||||
|
|
||||||
Source0: unit-%{version}.tar.gz
|
Source0: unit-%{version}.tar.gz
|
||||||
Source1: unit.service
|
Source1: unit.service
|
||||||
Source2: unit.example.config
|
Source2: unit-debug.service
|
||||||
Source3: unit.logrotate
|
Source3: unit.example.config
|
||||||
|
Source4: unit.logrotate
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
@@ -112,11 +113,11 @@ DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install
|
|||||||
%{__mkdir} -p %{buildroot}%{_localstatedir}/log/unit
|
%{__mkdir} -p %{buildroot}%{_localstatedir}/log/unit
|
||||||
%{__mkdir} -p %{buildroot}%{_localstatedir}/run/unit
|
%{__mkdir} -p %{buildroot}%{_localstatedir}/run/unit
|
||||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/logrotate.d
|
%{__mkdir} -p %{buildroot}%{_sysconfdir}/logrotate.d
|
||||||
%{__install} -m 644 -p %{SOURCE3} \
|
%{__install} -m 644 -p %{SOURCE4} \
|
||||||
%{buildroot}%{_sysconfdir}/logrotate.d/unit
|
%{buildroot}%{_sysconfdir}/logrotate.d/unit
|
||||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/unit
|
%{__mkdir} -p %{buildroot}%{_sysconfdir}/unit
|
||||||
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit/examples
|
%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit/examples
|
||||||
%{__install} -m 644 -p %{SOURCE2} \
|
%{__install} -m 644 -p %{SOURCE3} \
|
||||||
%{buildroot}%{_datadir}/doc/unit/examples/example.config
|
%{buildroot}%{_datadir}/doc/unit/examples/example.config
|
||||||
%{__install} -m 644 -p CHANGES \
|
%{__install} -m 644 -p CHANGES \
|
||||||
%{buildroot}%{_datadir}/doc/unit/
|
%{buildroot}%{_datadir}/doc/unit/
|
||||||
@@ -127,6 +128,7 @@ DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install
|
|||||||
|
|
||||||
%{__rm} -rf %{buildroot}%{_initrddir}/
|
%{__rm} -rf %{buildroot}%{_initrddir}/
|
||||||
%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/unit.service
|
%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/unit.service
|
||||||
|
%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/unit-debug.service
|
||||||
|
|
||||||
QA_SKIP_BUILD_ROOT=1
|
QA_SKIP_BUILD_ROOT=1
|
||||||
export QA_SKIP_BUILD_ROOT
|
export QA_SKIP_BUILD_ROOT
|
||||||
@@ -153,6 +155,7 @@ getent passwd unit >/dev/null || \
|
|||||||
-d /nonexistent -c "unit user" unit
|
-d /nonexistent -c "unit user" unit
|
||||||
if [ $1 -eq 1 ]; then
|
if [ $1 -eq 1 ]; then
|
||||||
/usr/bin/systemctl preset unit.service >/dev/null 2>&1 ||:
|
/usr/bin/systemctl preset unit.service >/dev/null 2>&1 ||:
|
||||||
|
/usr/bin/systemctl preset unit-debug.service >/dev/null 2>&1 ||:
|
||||||
cat <<BANNER
|
cat <<BANNER
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -200,6 +203,7 @@ BANNER
|
|||||||
%attr(0755,root,root) %{_sbindir}/unitd-debug
|
%attr(0755,root,root) %{_sbindir}/unitd-debug
|
||||||
%dir %{_sysconfdir}/unit
|
%dir %{_sysconfdir}/unit
|
||||||
%{_unitdir}/unit.service
|
%{_unitdir}/unit.service
|
||||||
|
%{_unitdir}/unit-debug.service
|
||||||
%dir %attr(0755,root,root) %ghost %{_localstatedir}/run/unit
|
%dir %attr(0755,root,root) %ghost %{_localstatedir}/run/unit
|
||||||
%dir %{_datadir}/doc/unit
|
%dir %{_datadir}/doc/unit
|
||||||
%{_datadir}/doc/unit/*
|
%{_datadir}/doc/unit/*
|
||||||
|
|||||||
Reference in New Issue
Block a user