-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyPiBot.service
More file actions
41 lines (38 loc) · 1.44 KB
/
Copy pathpyPiBot.service
File metadata and controls
41 lines (38 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Systemd service configuration for the Theo robot runtime
#
# To install:
# 1) Copy this file into the systemd area:
# sudo cp pyPiBot.service /lib/systemd/system/
# 2) Refresh system cache for services:
# sudo systemctl daemon-reload
# 3) Make the service start on boot:
# sudo systemctl enable pyPiBot.service
# 4) Start the service now:
# sudo service pyPiBot start
#
# Quick Reference:
# start service : sudo service pyPiBot start
# restart service : sudo service pyPiBot restart
# stop service : sudo service pyPiBot stop
[Unit]
Description=Theo Generative AI Robot Assistant
Wants=network-online.target
After=network-online.target nss-lookup.target sound.target
[Service]
# Startup policy: best-effort sync. Theo should still boot even if git sync fails,
# so ExecStartPre is prefixed with '-' to ignore non-zero exit codes.
ExecStartPre=-/home/pi/workarea/pyPiBot/scripts/systemd-git-sync.sh
TimeoutStartSec=60s
ExecStart=/home/pi/workarea/pyPiBot/.venv/bin/python /home/pi/workarea/pyPiBot/main.py \
--prompts "Say Hello World! or whatever fun salutation you prefer"
ExecStop=/bin/kill -SIGTERM $MAINPID
WorkingDirectory=/home/pi/workarea/pyPiBot/
EnvironmentFile=-/etc/environment
Environment="XDG_RUNTIME_DIR=/run/user/1000"
SyslogIdentifier=pyPiBot
StandardOutput=append:/home/pi/workarea/pyPiBot/log/pyPiBot.log
StandardError=append:/home/pi/workarea/pyPiBot/log/pyPiBot-error.log
User=pi
Restart=always
[Install]
WantedBy=multi-user.target