commit 8933fa140ae2ec75b6122851e276ed1700166286
Author: Richard Shaw <hobbes1069(a)gmail.com>
Date: Tue Nov 13 15:13:59 2018 -0600
Update systemd service file to deal with Java 10 in F29+, fixes BZ#5080.
unifi.service | 5 +++--
unifi.spec | 20 +++++++++++++++++++-
2 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/unifi.service b/unifi.service
index ee71880..b4076e5 100644
--- a/unifi.service
+++ b/unifi.service
@@ -7,12 +7,13 @@ Wants=network-online.target
Type=simple
User=unifi
WorkingDirectory=/usr/share/unifi
+EnvironmentFile=-/etc/sysconfig/unifi
# Has to be run though bash script due to java issue, see:
#
https://bugzilla.redhat.com/show_bug.cgi?id=1358476#c20
#ExecStart=/usr/sbin/unifi start
#ExecStop=/usr/sbin/unifi stop
-ExecStart=/usr/bin/java -jar /usr/share/unifi/lib/ace.jar start
-ExecStop=/usr/bin/java -jar /usr/share/unifi/lib/ace.jar stop
+ExecStart=/usr/bin/java $JAVA_OPTS -jar /usr/share/unifi/lib/ace.jar start
+ExecStop=/usr/bin/java $JAVA_OPTS -jar /usr/share/unifi/lib/ace.jar stop
Restart=on-success
[Install]
diff --git a/unifi.spec b/unifi.spec
index e3ed861..a24d0b2 100644
--- a/unifi.spec
+++ b/unifi.spec
@@ -5,7 +5,7 @@
Name: unifi
Version: 5.9.29
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Ubiquiti UniFi controller
License: Proprietary
@@ -211,6 +211,20 @@ install -p %{SOURCE100} %{SOURCE101} .
install -pm 0755 %{SOURCE6} %{buildroot}%{_datadir}/unifi/bin/mongod
%endif
+#
+# Workaround for java.activation module being depreceated in Java 10
+# It is removed from Java 11 (worry about it when it's in Fedora)
+# Fixes RFBZ#5080, also see:
+#
https://community.ubnt.com/t5/UniFi-Wireless/Running-Unifi-Controller-on-...
+#
+%if 0%{?fedora} >= 29
+mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+cat << EOF > %{buildroot}%{_sysconfdir}/sysconfig/%{name}
+JAVA_OPTS="--add-modules java.activation"
+EOF
+%else
+touch %{buildroot}%{_sysconfdir}/%{name}
+%endif
%pre
@@ -276,6 +290,7 @@ fi
%endif
%{_sbindir}/%{name}
%{_sysconfdir}/logrotate.d/%{name}
+%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_unitdir}/%{name}.service
%{_prefix}/lib/firewalld/services/%{name}.xml
%ghost %attr(-,unifi,unifi) %config(missingok,noreplace)
%{_sharedstatedir}/%{name}/data/system.properties
@@ -291,6 +306,9 @@ fi
%changelog
+* Tue Nov 13 2018 Richard Shaw <hobbes1069(a)gmail.com> - 5.9.29-2
+- Update systemd service file to deal with Java 10 in F29+, fixes BZ#5080.
+
* Thu Oct 04 2018 Richard Shaw <hobbes1069(a)gmail.com> - 5.9.29-1
- Update to 5.9.29, see:
https://community.ubnt.com/t5/UniFi-Updates-Blog/UniFi-SDN-Controller-5-9...