Installing the server as services using systemd
You can find information about the steps to install the server to run as systemd services. After you configure a server using the systemd service, the server automatically restarts when it stops abruptly.
Before you begin
About this task
Procedure
- Log in to the server host machine.
-
Locate the product systemd directory by using the following command:
cd <install-directory>/bin/systemd
-
Edit the unit file and specify the User and
Group values that will run the server.
User: The name of the user who will run the server.
Group: The name of the group associated with the user.
Your interface might look like the following example:Description=DevOps Deploy Server After=network.target [Service] # These must be changed (or removed) to set the appropriate agent account. User=ec2-user Group=ec2-user # Modifications to these are not supported. ExecStart="/home/ec2-user/ucd/server/bin/server” _systemd Type=exec KillSignal=SIGTERM SuccessExitStatus=0 9 143 Restart=on-failure RestartForceExitStatus=9 [Install] WantedBy=multi-user.target
Note: When you customize the user and group values, you must update the ownership of the server files to match with the updated User and Group values. -
Install the service unit file by using the following commands:
sudo cp devops-deploy-server.service /etc/systemd/system sudo chmod 664 /etc/systemd/system/devops-deploy-server.service sudo chown root:root /etc/systemd/system/devops-deploy-server.service sudo systemctl daemon-reload -
Enable the service to start automatically on system startup by using the
following command:
sudo systemctl enable devops-deploy-server
-
Start the server as service by using the following command:
sudo systemctl start devops-deploy-server
Results
What to do next
sudo systemctl status devops-deploy-server