0

How to Start Ubooquity on Ubuntu 16.04

RobL 6 years ago updated by Kcubor 6 years ago 1

I have just installed Ubooquity on Ubuntu 16.04. I can launch it from the CLI and it seems to be working just fine.
I cannot however get Ubooquity to run as a service. The posts and how-tos on this are all (or at least ones I've found) all use upstart.
Unfortunately 16.04 now uses systemd and upstart.
Does anyone have a systemd start up for Ubooquity?

Got it! (I'm on 18.04, but I think should work on 16.04)


Used this page: https://dzone.com/articles/run-your-java-application-as-a-service-on-ubuntu

I named my service ubooquity.service (my-webapp.service in the example) and matched User, WorkingDirectory and ExecStart to what my install was (/srv/ubooquity in my case).


Step 2 doesn't say it, but that script is what you define in ExecStart.  Here's my script (ubooquity.sh):

#!/bin/bash

sudo /usr/bin/java -Xmx512m -jar /srv/ubooquity/Ubooquity.jar --remoteadmin --headless


There is one additional step that you have to do, you have to give your user passwordless permissions in sudoers.  The trick with this is that it needs to be the very last line in sudoers so that it gets picked up, sudoers takes the last match found in the file, so if you user has less restrictive permissions after your line it won't take your passwordless option.  This is the line I used (with generic username of ubuntu).

ubuntu    ALL=(ALL)    NOPASSWD: /usr/bin/java


That sudoers line is what was frustrating me.  Hopefully this works for you.