-
Notifications
You must be signed in to change notification settings - Fork 0
/
grol.service
38 lines (36 loc) · 1.08 KB
/
grol.service
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
# Systemd thin wrapper to run with restarts etc.
# Install/setup:
# sudo ln -s `pwd`/grol.service /etc/systemd/system
# sudo systemctl daemon-reload
# sudo systemctl enable grol
# sudo systemctl restart grol
# sudo systemctl status grol
# Monitor the logs using:
# journalctl -u grol -o cat -f | logc
# (go install fortio.org/logc@latest)
[Unit]
Description=GROL Discord bot
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu/grol-discord-bot
ExecStart=/home/ubuntu/go/bin/grol-discord-bot
Restart=always
RestartSec=1
# Security hardening
CapabilityBoundingSet=
AmbientCapabilities=
NoNewPrivileges=true
ProtectSystem=strict
PrivateDevices=true
# ProtectHome=true
PrivateTmp=true
# Place the DISCORD_BOT_TOKEN= in that file and chmod 400 it.
# Note: should use LoadCredential= instead as this isn't very secure.
EnvironmentFile=/home/ubuntu/grol-discord-bot/.dtoken
Environment=GOMEMLIMIT=1GiB
Environment=DISCORD_BOT_ADMIN=477231908984586240
# Don't let it go too much above the soft limit (newer grol has memory checks too)
MemoryHigh=1.5G
MemoryMax=2G
[Install]
WantedBy=multi-user.target