How do I create a service in Ubuntu?

How do I create a service in Ubuntu?
Answer
Run Your Java App as a Service on Ubuntu
  1. Step 1: Create a Service. sudo vim /etc/systemd/system/my-webapp.service.
  2. Step 2: Create a Bash Script to Call Your Service. Here’s the bash script that calls your JAR file: my-webapp.
  3. Step 3: Start the Service. sudo systemctl daemon-reload.
  4. Step 4: Set Up Logging. First, run: sudo journalctl –unit=my-webapp .
 

Tìm kiếm

Back
Top