From 0c1abda39110fb0dccf8853996897fe24454930d Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Wed, 16 Dec 2020 09:56:01 +0300 Subject: Packages: the NOTICE file added to debian binaries. This resolves the following lintian error: https://lintian.debian.org/tags/missing-notice-file-for-apache-license.html While here, changed upstream changelog name to conform with the policy: https://lintian.debian.org/tags/wrong-name-for-upstream-changelog.html --- pkg/deb/debian/rules.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/deb/debian') diff --git a/pkg/deb/debian/rules.in b/pkg/deb/debian/rules.in index a4696793..3d6bfe22 100644 --- a/pkg/deb/debian/rules.in +++ b/pkg/deb/debian/rules.in @@ -104,8 +104,9 @@ install: build do.tests install -m 644 $(BUILDDIR_unit_debug)/build/libunit.a $(INSTALLDIR_dev)/usr/lib/$(DEB_HOST_MULTIARCH)/libunit-debug.a mkdir -p $(INSTALLDIR)/usr/share/doc/unit/examples install -m 644 debian/unit.example.config $(INSTALLDIR)/usr/share/doc/unit/examples/example.config - install -m 644 CHANGES $(INSTALLDIR)/usr/share/doc/unit/ + install -m 644 CHANGES $(INSTALLDIR)/usr/share/doc/unit/changelog install -m 644 README $(INSTALLDIR)/usr/share/doc/unit/ + install -m 644 NOTICE $(INSTALLDIR)/usr/share/doc/unit/ binary-indep: build install dh_testdir -- cgit From 9c09bc17726ccb2ab769faec6aacbe38db1b2e0f Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 24 Nov 2020 13:25:09 +0300 Subject: Packages: dropped support for non-systemd distributions. --- pkg/deb/debian/rules.in | 2 +- pkg/deb/debian/unit.init | 74 ------------------------------------------------ 2 files changed, 1 insertion(+), 75 deletions(-) delete mode 100644 pkg/deb/debian/unit.init (limited to 'pkg/deb/debian') diff --git a/pkg/deb/debian/rules.in b/pkg/deb/debian/rules.in index 3d6bfe22..1e76830f 100644 --- a/pkg/deb/debian/rules.in +++ b/pkg/deb/debian/rules.in @@ -96,7 +96,7 @@ install: build do.tests dh_testroot dh_prep dh_installdirs - dh_installinit + dh_installsystemd dh_installlogrotate cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR) make install cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR_dev) make libunit-install diff --git a/pkg/deb/debian/unit.init b/pkg/deb/debian/unit.init deleted file mode 100644 index 900e97fd..00000000 --- a/pkg/deb/debian/unit.init +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# -# unitd NGINX Unit -# -### BEGIN INIT INFO -# Provides: unitd -# Required-Start: $network $remote_fs -# Required-Stop: $network $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: NGINX Unit -# Description: NGINX Unit -### END INIT INFO -PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/unitd -NAME=unit -DESC=unitd - -#includes lsb functions -. /lib/lsb/init-functions - -test -f $DAEMON || exit 0 - -umask 022 - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -case "$1" in - start) - log_daemon_msg "Starting $DESC" "$NAME" - if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON -- $DAEMON_ARGS; then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - status) - status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - if start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON; then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - reload|force-reload) - echo "Not implemented." >&2 - exit 1 - ;; - restart) - log_action_begin_msg "Restarting $DESC" "$NAME" - - start-stop-daemon --stop --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON || true - sleep 1 - if start-stop-daemon --start --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_ARGS; then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - *) - echo "Usage: /etc/init.d/$NAME {start|status|stop|restart|reload|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 -- cgit From a5fa9673d98c9c814c01ddfce8bcfbec6fcc02e8 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 24 Nov 2020 14:27:06 +0300 Subject: Packages: added pcre2 to build depends. While at it, propagate unit build depends to modules. --- pkg/deb/debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/deb/debian') diff --git a/pkg/deb/debian/control b/pkg/deb/debian/control index 9828b6ab..a8e8cdc4 100644 --- a/pkg/deb/debian/control +++ b/pkg/deb/debian/control @@ -4,7 +4,8 @@ Priority: extra Maintainer: Andrei Belov Build-Depends: debhelper (>= 9), linux-libc-dev, - libssl-dev + libssl-dev, + libpcre2-dev Standards-Version: 3.9.5 Homepage: https://unit.nginx.org -- cgit From 53d847615b270daf706373d65ac5f5d2101f36d9 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Thu, 17 Dec 2020 14:30:18 +0300 Subject: Packages: run non-privileged processes under "unit" user. --- pkg/deb/debian/unit.example.config | 4 ---- pkg/deb/debian/unit.postinst | 34 ++++++++++++++++++++++++++++++++++ pkg/deb/debian/unit.preinst | 1 + 3 files changed, 35 insertions(+), 4 deletions(-) (limited to 'pkg/deb/debian') diff --git a/pkg/deb/debian/unit.example.config b/pkg/deb/debian/unit.example.config index 5610cb3a..66695327 100644 --- a/pkg/deb/debian/unit.example.config +++ b/pkg/deb/debian/unit.example.config @@ -2,7 +2,6 @@ "applications": { "example_php": { "type": "php", - "user": "nobody", "processes": 2, "root": "/usr/share/doc/unit/examples/php-app", "index": "index.php" @@ -10,7 +9,6 @@ "example_python": { "type": "python", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit/examples/python-app", "module": "wsgi" @@ -18,13 +16,11 @@ "example_go": { "type": "external", - "user": "nobody", "executable": "/tmp/go-app" }, "example_perl": { "type": "perl", - "user": "nobody", "processes": 1, "working_directory": "/usr/share/doc/unit-perl/examples/perl-app", "script": "/usr/share/doc/unit-perl/examples/perl-app/index.pl" diff --git a/pkg/deb/debian/unit.postinst b/pkg/deb/debian/unit.postinst index 76375a2b..8aa476b3 100755 --- a/pkg/deb/debian/unit.postinst +++ b/pkg/deb/debian/unit.postinst @@ -6,6 +6,40 @@ if [ "$1" != "configure" ]; then exit 0 fi +if [ -n "$2" ]; then + if dpkg --compare-versions "${2%%-*}" le "1.21.0"; then + cat </dev/null; then + addgroup --system unit >/dev/null +fi + +if ! getent passwd unit >/dev/null; then + adduser \ + --system \ + --disabled-login \ + --ingroup unit \ + --no-create-home \ + --home /nonexistent \ + --gecos "unit user" \ + --shell /bin/false \ + unit >/dev/null +fi + #DEBHELPER# exit 0 diff --git a/pkg/deb/debian/unit.preinst b/pkg/deb/debian/unit.preinst index d4be468d..bd513788 100644 --- a/pkg/deb/debian/unit.preinst +++ b/pkg/deb/debian/unit.preinst @@ -17,6 +17,7 @@ Online documentation is available at https://unit.nginx.org/ ---------------------------------------------------------------------- BANNER ;; + upgrade) ;; -- cgit From 3abca42caf44f03941545e5e92f35c0f329640e7 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Mon, 28 Dec 2020 12:51:30 +0300 Subject: Packages: fixed building for Ubuntu 16.04 "xenial". Changes introduced in a27532e3a17b effectively broke building of the unit package due to missed dh_installsystemd script in older debhelper 9.x. Once Ubuntu 16.04 reach EOL, the following actions should be made: - this commit should be reverted; - minimal debhelper version should be increased to 11. --- pkg/deb/debian/rules.in | 5 ++++ pkg/deb/debian/unit.init | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 pkg/deb/debian/unit.init (limited to 'pkg/deb/debian') diff --git a/pkg/deb/debian/rules.in b/pkg/deb/debian/rules.in index 1e76830f..aa7921d1 100644 --- a/pkg/deb/debian/rules.in +++ b/pkg/deb/debian/rules.in @@ -10,6 +10,7 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +CODENAME := $(shell lsb_release -cs) BUILDDIR_unit = $(CURDIR)/debian/build-unit BUILDDIR_unit_debug = $(CURDIR)/debian/build-unit-debug @@ -96,7 +97,11 @@ install: build do.tests dh_testroot dh_prep dh_installdirs +ifeq ($(CODENAME), xenial) + dh_installinit +else dh_installsystemd +endif dh_installlogrotate cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR) make install cd $(BUILDDIR_unit) && DESTDIR=$(INSTALLDIR_dev) make libunit-install diff --git a/pkg/deb/debian/unit.init b/pkg/deb/debian/unit.init new file mode 100644 index 00000000..900e97fd --- /dev/null +++ b/pkg/deb/debian/unit.init @@ -0,0 +1,74 @@ +#!/bin/sh +# +# unitd NGINX Unit +# +### BEGIN INIT INFO +# Provides: unitd +# Required-Start: $network $remote_fs +# Required-Stop: $network $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: NGINX Unit +# Description: NGINX Unit +### END INIT INFO +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/unitd +NAME=unit +DESC=unitd + +#includes lsb functions +. /lib/lsb/init-functions + +test -f $DAEMON || exit 0 + +umask 022 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON -- $DAEMON_ARGS; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + status) + status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $? + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + reload|force-reload) + echo "Not implemented." >&2 + exit 1 + ;; + restart) + log_action_begin_msg "Restarting $DESC" "$NAME" + + start-stop-daemon --stop --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON || true + sleep 1 + if start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_ARGS; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|status|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 -- cgit From 6e28263d6531c9461a3a1d49a98bf8d33898c599 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 18 Jan 2021 16:48:47 +0300 Subject: Bumping year in copyright notice. --- pkg/deb/debian/copyright | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pkg/deb/debian') diff --git a/pkg/deb/debian/copyright b/pkg/deb/debian/copyright index 2acb87b9..2a2c5fd0 100644 --- a/pkg/deb/debian/copyright +++ b/pkg/deb/debian/copyright @@ -1,14 +1,14 @@ NGINX Unit. - Copyright 2017-2020 NGINX, Inc. - Copyright 2017-2020 Igor Sysoev - Copyright 2017-2020 Valentin V. Bartenev - Copyright 2017-2020 Max Romanov - Copyright 2017-2020 Andrei Zeliankou - Copyright 2017-2020 Andrei Belov - Copyright 2018-2020 Konstantin Pavlov - Copyright 2019-2020 Tiago Natel de Moura + Copyright 2017-2021 NGINX, Inc. + Copyright 2017-2021 Igor Sysoev + Copyright 2017-2021 Valentin V. Bartenev + Copyright 2017-2021 Max Romanov + Copyright 2017-2021 Andrei Zeliankou + Copyright 2017-2021 Andrei Belov + Copyright 2018-2021 Konstantin Pavlov + Copyright 2019-2021 Tiago Natel de Moura Copyright 2019-2020 Axel Duch Copyright 2018-2019 Alexander Borisov -- cgit