Create systemd service for Resilient Circuits

Creating a systemd service file to make Resilient Circuits runs automatically.


Author(s): Tamas Bures | Created: 16 April 2019 | Last modified: 29 March 2024
Tested on: -

Create systemd service for Resilient Circuits

  1. Create a file called resilient-circuits.service as root user at /etc/systemd/system path.

     touch /etc/systemd/system/resilient-circuits.service
  2. Add the following content and adjust the obvious values to match your environment:

     [Unit]
     Description=IBM Resilient-Circuits Service
     After=network.target
    
     [Service]
     Type=simple
     User=resilient
     WorkingDirectory=/home/resilient
     ExecStart=/usr/local/bin/resilient-circuits run
     Restart=always
     TimeoutSec=10
     Environment=APP_CONFIG_FILE=/home/resilient/.resilient/app.config
     Environment=APP_LOCK_FILE=/home/resilient/.resilient/resilient_circuits_lockfile
    
     [Install]
     WantedBy=multi-user.target

    If you run Resilient Circuits on Resilient appliance, you must add the following to options to the [Unit] section:

     After=resilient.service
     Requires=resilient.service

    For example:

     [Unit]
     Description=IBM Resilient-Circuits Service
     After=resilient.service
     Requires=resilient.service
    
     [Service]
     Type=simple
     User=resilient
     WorkingDirectory=/home/resilient
     ExecStart=/usr/local/bin/resilient-circuits run
     Restart=always
     TimeoutSec=10
     Environment=APP_CONFIG_FILE=/home/resilient/.resilient/app.config
     Environment=APP_LOCK_FILE=/home/resilient/.resilient/resilient_circuits_lockfile
    
     [Install]
     WantedBy=multi-user.target
  3. Save the file.

  4. Enable the service:

     systemctl enable resilient-circuits.service
  5. Start the service:

     systemctl start resilient-circuits.service
  6. Check service status:

     systemctl status resilient-circuits.service