debian: added systemd service files. As it depends on dh-systemd package being available in the distributions, this bumps operating system requirements to: - Ubuntu 14.04+ - Debian 8+ for debian-based targets.
diff --git a/debian/Makefile b/debian/Makefile index 1ce75e8..0d05e49 100644 --- a/debian/Makefile +++ b/debian/Makefile
@@ -280,7 +280,7 @@ -e 's#%%MAIN_RELEASE%%#$(BASE_RELEASE)#g' \ > debuild-base/$(SRCDIR)/debian/changelog ; \ cp nginx.control.in debuild-base/$(SRCDIR)/debian/control ; \ - cp copyright ../CHANGES ../CHANGES.ru nginx.* nginx-debug.default debuild-base/$(SRCDIR)/debian/ ; \ + cp copyright ../CHANGES ../CHANGES.ru nginx.* nginx-debug.default nginx-debug.service debuild-base/$(SRCDIR)/debian/ ; \ chmod +x debuild-base/$(SRCDIR)/debian/rules ; \ ln -s debuild-base/$(SRCDIR)/debian/rules rules-base ; \ }
diff --git a/debian/nginx-debug.service b/debian/nginx-debug.service new file mode 100644 index 0000000..f345ce5 --- /dev/null +++ b/debian/nginx-debug.service
@@ -0,0 +1,16 @@ +[Unit] +Description=nginx - high performance web server +Documentation=http://nginx.org/en/docs/ +After=network-online.target remote-fs.target nss-lookup.target +Wants=network-online.target + +[Service] +Type=forking +PIDFile=/var/run/nginx.pid +ExecStartPre=/usr/sbin/nginx-debug -t -c /etc/nginx/nginx.conf +ExecStart=/usr/sbin/nginx-debug -c /etc/nginx/nginx.conf +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s TERM $MAINPID + +[Install] +WantedBy=multi-user.target
diff --git a/debian/nginx.control.in b/debian/nginx.control.in index 56c0f27..d9fbf27 100644 --- a/debian/nginx.control.in +++ b/debian/nginx.control.in
@@ -3,6 +3,7 @@ Priority: optional Maintainer: Sergey Budnevitch <sb@nginx.com> Build-Depends: debhelper (>= 9~), + dh-systemd, dpkg-dev (>= 1.16.1~), quilt (>= 0.46-7~), lsb-release,
diff --git a/debian/nginx.service b/debian/nginx.service new file mode 100644 index 0000000..991207e --- /dev/null +++ b/debian/nginx.service
@@ -0,0 +1,16 @@ +[Unit] +Description=nginx - high performance web server +Documentation=http://nginx.org/en/docs/ +After=network-online.target remote-fs.target nss-lookup.target +Wants=network-online.target + +[Service] +Type=forking +PIDFile=/var/run/nginx.pid +ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf +ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s TERM $MAINPID + +[Install] +WantedBy=multi-user.target