Use Linux Systemd to start palo server

I'd like to share some work I did recently to get palo server to start automatically on boot using linux's systemd. Systemd has been in-use in fedora/RHEL for a while, but is now also being adopted by debian/ubuntu.

That leaves the palo.ini file and the palo.sevice files. First the palo.ini. I used the attached palo.ini file which I believe is pretty standard. I created the palo.ini file by pasting the contents into vi, but you could can create it using nano or gedit:

Source Code

cd /etc

sudo vi palo.ini

<i, paste, esc, shift-ZZ>

Finally the palo.service file. This is the file that defines how systemd will manage the palo server. I've attached the palo.serice file which I created. It's fairly self explanatory. The most important line is:
ExecStart=/usr/bin/palo --init-file /etc/palo.ini --data-directory /var/lib/palo/Data
Which defines how the palo server will be invoked. Since the data directory parameter is also present in the palo.ini file, ideally it would be possible to leave off the --data-directory parameter and thus allow the data directory to be configured via the palo.ini file. Unfortunatly leaving off the --data-directory parameter seems to prevent the palo server starting, so for the moment note that the palo.service file is definining the data location and not palo.ini.

Source Code

cd /usr/lib/systemd/system

sudo vi palo.service

<i, paste, esc, shift-ZZ>

All done in terms of the setup. You can test out the configuration immediately by using

Source Code

sudo systemctl daemon-reload

sudo systemctl start palo

Which should give you a palo server running in the background. Finally, to automatically start on boot enter:

Source Code

sudo systemctl enable palo

You should now be able to restart the computer and have the palo server started automatically.