fszontagh bc77b6424c Initial commit: SmartBotic workflow automation platform 6 luni în urmă
..
user bc77b6424c Initial commit: SmartBotic workflow automation platform 6 luni în urmă
README.md bc77b6424c Initial commit: SmartBotic workflow automation platform 6 luni în urmă

README.md

SmartBotic Systemd Services

This directory contains systemd user service files for managing SmartBotic processes.

Installation

  1. Link or copy the service files to your user systemd directory:

    mkdir -p ~/.config/systemd/user
    ln -sf /data/smartbotic/systemd/user/*.service ~/.config/systemd/user/
    ln -sf /data/smartbotic/systemd/user/*.target ~/.config/systemd/user/
    
  2. Reload systemd to pick up the new services:

    systemctl --user daemon-reload
    

Usage

Start all services

systemctl --user start smartbotic.target

Start individual services

systemctl --user start smartbotic-database
systemctl --user start smartbotic-webserver
systemctl --user start smartbotic-runner

Stop all services

systemctl --user stop smartbotic.target

Stop individual services

systemctl --user stop smartbotic-runner
systemctl --user stop smartbotic-webserver
systemctl --user stop smartbotic-database

Restart services

systemctl --user restart smartbotic-webserver
systemctl --user restart smartbotic-runner

Check status

systemctl --user status smartbotic-database
systemctl --user status smartbotic-webserver
systemctl --user status smartbotic-runner

View logs

# Follow logs for a specific service
journalctl --user -u smartbotic-webserver -f

# View last 100 lines
journalctl --user -u smartbotic-runner -n 100

# View all SmartBotic logs
journalctl --user -u 'smartbotic-*' -f

Enable auto-start on login

systemctl --user enable smartbotic.target

Disable auto-start

systemctl --user disable smartbotic.target

Service Dependencies

smartbotic-database
       ↓
smartbotic-webserver
       ↓
smartbotic-runner

The services have proper dependency ordering:

  • smartbotic-database must start first
  • smartbotic-webserver depends on database and starts after it
  • smartbotic-runner depends on webserver and starts after it

Environment Variables

You can override environment variables in the service files or create an override:

systemctl --user edit smartbotic-runner

Add your overrides:

[Service]
Environment=LOG_LEVEL=debug
Environment=RUNNER_ID=my-runner

Troubleshooting

If services fail to start, check the logs:

journalctl --user -u smartbotic-database -e
journalctl --user -u smartbotic-webserver -e
journalctl --user -u smartbotic-runner -e

Common issues:

  • Port already in use: Check if another instance is running
  • Database connection failed: Ensure database service is running
  • Runner registration failed: Ensure webserver is accessible