summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm/rpmbuild
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/rpm/rpmbuild')
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/unit.logrotate10
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/unit.service20
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/unit.sysconf2
3 files changed, 27 insertions, 5 deletions
diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.logrotate b/pkg/rpm/rpmbuild/SOURCES/unit.logrotate
new file mode 100644
index 00000000..8fb00199
--- /dev/null
+++ b/pkg/rpm/rpmbuild/SOURCES/unit.logrotate
@@ -0,0 +1,10 @@
+/var/log/unit/*.log {
+ missingok
+ nocreate
+ notifempty
+ postrotate
+ if [ -f /var/run/unit/unit.pid ]; then
+ /bin/kill -SIGUSR1 `cat /var/run/unit/unit.pid`
+ fi
+ endscript
+}
diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.service b/pkg/rpm/rpmbuild/SOURCES/unit.service
index 4aaf70cd..f888685f 100644
--- a/pkg/rpm/rpmbuild/SOURCES/unit.service
+++ b/pkg/rpm/rpmbuild/SOURCES/unit.service
@@ -1,14 +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" 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 /run/unit/unit.pid"
+
[Unit]
Description=NGINX Unit
Wants=network-online.target
After=network-online.target
[Service]
-Type=forking
-PIDFile=/run/unit.pid
-EnvironmentFile=-/etc/sysconfig/unit
-ExecStart=/usr/sbin/unitd $UNITD_OPTIONS
+Type=simple
+Environment="UNITD_OPTIONS=--log /var/log/unit/unit.log --pid /run/unit/unit.pid"
+ExecStart=/usr/sbin/unitd $UNITD_OPTIONS --no-daemon
ExecReload=
+RuntimeDirectory=unit
+RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.sysconf b/pkg/rpm/rpmbuild/SOURCES/unit.sysconf
index 0b28558f..9146bdac 100644
--- a/pkg/rpm/rpmbuild/SOURCES/unit.sysconf
+++ b/pkg/rpm/rpmbuild/SOURCES/unit.sysconf
@@ -1 +1 @@
-UNITD_OPTIONS="--log /var/log/unit.log --pid /run/unit.pid"
+UNITD_OPTIONS="--log /var/log/unit/unit.log --pid /var/run/unit/unit.pid"