UniFi systemd unit file for Ubuntu 15.04

At work we’ve started using some UniFi wireless gear and the system I’ve managed to commandeer to do the control system for it is running Kubuntu 15.04 which uses systemd. Now the UniFi Debian packages don’t supply systemd unit files so I went hunting and found a blog post by Derek Horn about getting it running on CentOS7 so I nabbed his and adapted it for Ubuntu (which wasn’t that hard).

The file lives in /etc/systemd/system/unifi.service and was enabled with systemctl enable unifi.service (from memory, there might have been another step that involved getting systemd to rescan unit files to pick up the new one, but I don’t remember for sure).

Here is the unit file:

#
# Systemd unit file for unifi-rapid
#

[Unit]
Description=UniFi Wireless AP Control System
After=rsyslog.target network.target

[Service]
Type=simple
User=root
#ExecStart=/usr/bin/java -Xmx1024M -jar /usr/lib/unifi/lib/ace.jar start
ExecStart=/usr/bin/jsvc -nodetach -home /usr/lib/jvm/java-7-openjdk-amd64 -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi/unifi.pid -procname unifi -outfile SYSLOG -errfile SYSLOG -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx1024M com.ubnt.ace.Launcher start
#ExecStop=/usr/bin/java -jar /usr/lib/unifi/lib/ace.jar stop
ExecStop=/usr/bin/jsvc -home /usr/lib/jvm/java-7-openjdk-amd64 -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi/unifi.pid -procname unifi -outfile SYSLOG -errfile SYSLOG -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx1024M -stop com.ubnt.ace.Launcher stop
SuccessStartStatus=0
SuccessExitStatus=255

[Install]
WantedBy=multi-user.target

Dependency Problems with KDE 4.6.0 RC1 Packages for Ubuntu 10.10 (FIXED)

Update: this issue has been fixed by the packagers. See the bug for more info.

I saw the notice about the KDE 4.6.0 RC1 packages being released for Kubuntu 10.10 today and decided to look at upgrading (or at least grab all the packages with aptitude dist-upgrade -d) and got a surprise that it wanted to remove 250 packages due to dependency problems. The issues were:

The following packages have unmet dependencies:
   libqapt-runtime: Depends: libpolkit-qt-1-1 which is a virtual package.
   polkit-kde-1: Depends: libpolkit-qt-1-1 which is a virtual package.
   kdelibs5-plugins: Depends: libpolkit-qt-1-1 which is a virtual package.
   libgpgme++2: Depends: libgpg-error0 (>= 1.10) but 1.6-1ubuntu2 is installed.

Turns out that libpolkit-qt-1-1 and the newer version of libgpg-error0 are in the alpha for the next version of Kubuntu (Natty Narwhal) but not in Maverick (10.10), hence the chaos. The bug is reported as LP bug #694053 and thanks to Murz for spotting that you can just grab and dpkg -i the missing packages – see the bug report for details and links!