From 8bcb8373039d16f2ae485ec1ae6d4c26efece322 Mon Sep 17 00:00:00 2001
From: Adrian Reber <adrian(a)lisas.de>
Date: Tue, 1 Dec 2015 08:10:19 +0100
Subject: Fixed "Service fails to start because it's run as root" (#1278027)
---
vnstat.service.patch | 10 ++++++++++
vnstat.spec | 7 ++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
create mode 100644 vnstat.service.patch
diff --git a/vnstat.service.patch b/vnstat.service.patch
new file mode 100644
index 0000000..4033530
--- /dev/null
+++ b/vnstat.service.patch
@@ -0,0 +1,10 @@
+--- a/examples/systemd/vnstat.service 2015-12-01 08:05:12.053856367 +0100
++++ b/examples/systemd/vnstat.service 2015-12-01 08:05:07.967936194 +0100
+@@ -4,6 +4,7 @@
+ After=network.target
+
+ [Service]
++User=vnstat
+ ExecStart=/usr/sbin/vnstatd -n
+ ExecReload=/bin/kill -HUP $MAINPID
+
diff --git a/vnstat.spec b/vnstat.spec
index 3a6f10a..fba26f1 100644
--- a/vnstat.spec
+++ b/vnstat.spec
@@ -1,12 +1,13 @@
Summary: Console-based network traffic monitor
Name: vnstat
Version: 1.14
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2
Group: System Environment/Daemons
URL:
http://humdi.net/vnstat/
Source0:
http://humdi.net/vnstat/vnstat-%{version}.tar.gz
+Patch0: vnstat.service.patch
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
@@ -22,6 +23,7 @@ be used without root permissions. See the web-page for few
'screenshots'.
%prep
%setup -q
+%patch0 -p1
# disable maximum bandwidth setting and change pidfile location
sed -i -e "s,/var/run/,/run/vnstat/,g; \
@@ -95,6 +97,9 @@ exit 0
%changelog
+* Tue Dec 01 2015 Adrian Reber <adrian(a)lisas.de> - 1.14-3
+- Fixed "Service fails to start because it's run as root" (#1278027)
+
* Tue Aug 11 2015 Adrian Reber <adrian(a)lisas.de> - 1.14-2
- Use %%license for COPYING
--
cgit v0.11.2
http://pkgs.fedoraproject.org/cgit/vnstat.git/commit/?h=master&id=8bc...