Skip to content

Commit

Permalink
add systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
csenet committed Dec 20, 2024
1 parent 7099d35 commit 14cf64e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/km4k2.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=KM4K2
After=network.target

[Service]
WorkingDirectory = /home/pi/KM4K2
Type=simple
ExecStart=/usr/bin/python3 -m km4k2
ExecStop=/bin/kill -WINCH ${MAINPID}
KillSignal=SIGCONT
Environment=API_KEY=aQLjnVKbKeX4pFXBHGJmVFdERfGYi4JCjt2Dq4PjV3yJe9uLtNAHAV7
Environment=CARD_MANAGER_BASE_URL=https://card.ueckoken.club
Environment=REDIS_HOST=localhost
Environment=REDIS_PORT=6379
Environment=REDIS_DB=0

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sudo cp km4k2.service /etc/systemd/system/
sudo systemctl enable km4k2
sudo systemctl start km4k2

0 comments on commit 14cf64e

Please sign in to comment.