From 17edc5f4777dbb357494a8880dab89fc87d5fd4a Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 5 Feb 2026 15:27:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5systemd=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/astrbot.service | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 scripts/astrbot.service diff --git a/scripts/astrbot.service b/scripts/astrbot.service new file mode 100644 index 0000000000..fdf891be9f --- /dev/null +++ b/scripts/astrbot.service @@ -0,0 +1,15 @@ +[Unit] +Description=AstrBot Service +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +WorkingDirectory=%h/.local/share/astrbot +ExecStart=/usr/bin/sh -c '/usr/bin/astrbot run || { /usr/bin/astrbot init && /usr/bin/astrbot run; }' +Restart=on-failure +RestartSec=5 +Environment=PYTHONUNBUFFERED=1 + +[Install] +WantedBy=default.target