Skip to content

Instantly share code, notes, and snippets.

@bossjones
Created January 18, 2026 16:51
Show Gist options
  • Select an option

  • Save bossjones/c7ec84f37d9f26b74966843bf25c2f92 to your computer and use it in GitHub Desktop.

Select an option

Save bossjones/c7ec84f37d9f26b74966843bf25c2f92 to your computer and use it in GitHub Desktop.
systemd service for cerebro-botv3
#!/bin/zsh
# Load pyenv
source "/home/pi/.local/share/chezmoi/home/shell/pyenv/env.zsh"
source "/home/pi/.local/share/chezmoi/home/shell/pyenv/path.zsh"
# Change to bot directory
cd /home/pi/dev/universityofprofessorex/cerebro-botv3
# Activate the virtual environment
pyenv activate cerebro-bot3910
# Load environment variables
source /home/pi/dev/universityofprofessorex/cerebro-botv3/.envrc
# Run the bot
exec cerebroctl run
[Unit]
Description=Cerebro Bot v3
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=pi
Group=pi
WorkingDirectory=/home/pi/dev/universityofprofessorex/cerebro-botv3
ExecStart=/home/pi/bin/cerebro-botv3-start.sh
Restart=on-failure
RestartSec=10
# Hardening options
NoNewPrivileges=true
PrivateTmp=true
# Environment
Environment="HOME=/home/pi"
Environment="PYENV_ROOT=/home/pi/.pyenv"
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment