From 6b80254e0b59fb8346f05284a112f88dd930434a Mon Sep 17 00:00:00 2001 From: Ting-Jun Wang Date: Sun, 28 Aug 2022 23:02:59 +0800 Subject: [PATCH] feat: systemd service unit file --- ncnu-course-api.service | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ncnu-course-api.service diff --git a/ncnu-course-api.service b/ncnu-course-api.service new file mode 100644 index 0000000..09441f6 --- /dev/null +++ b/ncnu-course-api.service @@ -0,0 +1,20 @@ +[Unit] +Description=NCNU-Course Python Backend API +After=network.target + +[Service] +Type=simple +ExecStart=python3 api.py +Restart=always + +WorkingDirectory=/var/www/html/NCNU_Course +User=pi + +RestartSec=10s + +StandardOutput=syslog +StandardOutput=syslog +SyslogIdentifier=ncnu-course + +[Install] +WantedBy=multi-user.target