This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This method uses the modern systemd way to run a Java JAR (i.e. a Spring Boot app) as a daemon as opposed to using the older method of using init.d (SystemV). Using the "&" symbol to run the process in the background isn't sufficient b/c the process will be shut down when the terminal closes (or when you exit your SSH session if remoting in to the machine). Using the "nohup" command is another option, but that is like the "poor man's way" of running a service: doesn't restart on machine reboot; program ignores interrupts, quit signals, and hangups. For more info see: https://stackoverflow.com/questions/958249/whats-the-difference-between-nohup-and-a-daemon . | |
Anyways, to create a Linux daemon the systemd way: | |
Create a service file in /etc/systemd/system. Let's call it javaservice.service. Let the contents be: | |
[Unit] | |
Description=My Java Service | |
[Service] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model; | |
import java.util.List; | |
public class Customer { | |
private String name; | |
private String email; | |
private String password; | |
private String[] qoute; | |
private boolean isAdmin; |