TachiWeb-Server icon indicating copy to clipboard operation
TachiWeb-Server copied to clipboard

Run TachiWeb-Server on startup

Open calgara12 opened this issue 8 years ago • 2 comments

Hey, is it possible to make the application start on startup?

If yes how would i do it? I tried creating a tachi.service file which contained this: [Unit] Description= TachiWeb-Server After=network.target

[Service] Type=simple User=tachi Group=tachi ExecStart=/usr/bin/java -jar /path/to/TachiServer-all-1.0.jar

[Install] WantedBy=default.target

On startup, the application started, but nothing would load. It stated that the library failed to load, the catalogues also didnt load.

calgara12 avatar Sep 18 '17 18:09 calgara12

The simplest method would be to just use the crontab, if you are on Debian/Ubuntu you can use the commands below to do this:

  1. Ensure you have cron installed: sudo apt-get install cron.
  2. Add the tachi user account if you haven't done so already: sudo adduser tachi. Use whatever password you want when asked to enter one.
  3. Log into the tachi user: su tachi.
  4. Download TachiWeb-Server onto the new user account: cd ~ && wget https://ci.nulldev.xyz/job/TachiWeb-Server/lastSuccessfulBuild/artifact/TachiServer/build/libs/TachiServer-all-1.0.jar
  5. Open the crontab: crontab -e. Choose nano as the editor if you are asked.
  6. Add the following line to the bottom:
@reboot cd /home/tachi && /usr/bin/java -jar TachiServer-all-1.0.jar
  1. Save your changes and close nano: Press Ctrl+X, press Y and then press ENTER.
  2. Reboot and see if you can access the program.

null-dev avatar Sep 18 '17 20:09 null-dev

The user and group tag in the systemd service file need to be created, alternatively use "nobudy" and make sure that the jar is executable by others. (i.e. chmod 111) @Flat

covert8 avatar Mar 25 '19 05:03 covert8