Skip to content

Instantly share code, notes, and snippets.

@ajford
Created December 25, 2016 02:09
Show Gist options
  • Save ajford/98b7656c709b63a2f270ea41fcf52621 to your computer and use it in GitHub Desktop.
Save ajford/98b7656c709b63a2f270ea41fcf52621 to your computer and use it in GitHub Desktop.
Systemd service file for justseed.it downloader

This gist assumes the justseedit pieces downloader jar is placed in a directory named .justseedit within the home directory of a user with a username of user. Feel free to change this location to wherever you please.

It also assumes that /usr/bin/java/ is a compatible java implementation (at the time of writing, Oracle JRE 8).

It is recommended that you run the downloader manually via java -jar first, so you can verify that it's functioning correctly first. Don't forget you will need to modify the settings/api.txt and settings/piece_downloader.txt with your settings (at minimum the api key for your account.

If you wish to use the justseed.it downloader instead of the pieces downloader, you can change line 6 of the service file to reflect the name change (i.e. justseedit_downloader.jar instead of justseedit_piece_downloader.jar).

If you are unfamiliar with systemd services, the justseed.service file should be placed at /etc/systemd/system/, and will require sudo/root privs to do so. After placing there, you will have to enable the justseed servince with sudo systemctl enable justseed.

Hope this helps any fledgling Linux users having trouble with this!

[Unit]
Description=Justseed.it downloader
[Service]
WorkingDirectory=/home/user/.justseedit
ExecStart=/usr/bin/java -jar /home/user/.justseedit/justseedit_piece_downloader.jar
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment