Systemd Service
Run Mudabbir as a background service on Linux with systemd for automatic startup and restart.
Service File
Create /etc/systemd/system/mudabbir.service:
[Unit]Description=Mudabbir AI AgentAfter=network.target
[Service]Type=simpleUser=mudabbirGroup=mudabbirWorkingDirectory=/home/mudabbirExecStart=/usr/local/bin/mudabbirRestart=on-failureRestartSec=10
# EnvironmentEnvironmentFile=/etc/mudabbir/env
# Security hardeningNoNewPrivileges=yesProtectSystem=strictProtectHome=read-onlyReadWritePaths=/home/mudabbir/.mudabbirPrivateTmp=yes
[Install]WantedBy=multi-user.targetEnvironment File
Create /etc/mudabbir/env:
MUDABBIR_ANTHROPIC_API_KEY=sk-ant-your-keyMUDABBIR_WEB_HOST=127.0.0.1MUDABBIR_WEB_PORT=8888MUDABBIR_AGENT_BACKEND=claude_agent_sdkMUDABBIR_TOOL_PROFILE=codingSet permissions:
sudo chmod 600 /etc/mudabbir/envsudo chown mudabbir:mudabbir /etc/mudabbir/envSetup
# Create dedicated usersudo useradd -m -s /bin/bash mudabbir
# Install Mudabbirsudo -u mudabbir pip install --user mudabbir[recommended]
# Create config directorysudo mkdir -p /etc/mudabbirsudo chown mudabbir:mudabbir /etc/mudabbir
# Enable and start servicesudo systemctl daemon-reloadsudo systemctl enable mudabbirsudo systemctl start mudabbirManaging the Service
# Startsudo systemctl start mudabbir
# Stopsudo systemctl stop mudabbir
# Restartsudo systemctl restart mudabbir
# Check statussudo systemctl status mudabbir
# View logssudo journalctl -u mudabbir -f
# View recent logssudo journalctl -u mudabbir --since "1 hour ago"Log Rotation
Systemd handles log rotation via journald. For the audit log, add a logrotate config:
/home/mudabbir/.mudabbir/audit.jsonl { weekly rotate 12 compress missingok notifempty copytruncate}Auto-Updates
Create a timer for periodic updates:
[Unit]Description=Update Mudabbir weekly
[Timer]OnCalendar=weeklyPersistent=true
[Install]WantedBy=timers.target[Unit]Description=Update Mudabbir
[Service]Type=oneshotUser=mudabbirExecStart=/usr/local/bin/pip install --upgrade mudabbir[recommended]ExecStartPost=/bin/systemctl restart mudabbirWas this page helpful?