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