-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJohnBot.service
More file actions
30 lines (27 loc) · 928 Bytes
/
JohnBot.service
File metadata and controls
30 lines (27 loc) · 928 Bytes
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
# Example file for setting up the app as a linux service
#
# Copy service file to /etc/systemd/system/JohnBot.service
# sudo cp JohnBot.service /etc/systemd/system
# sudo nano /etc/systemd/system/JohnBot.service
#
# Add the following aliases to .bashrc to set up and check the service
#alias logs='journalctl --no-page -u JohnBot'
#alias enables='sudo systemctl enable JohnBot.service'
#alias disables='sudo systemctl disable JohnBot.service'
#alias stops='sudo systemctl stop JohnBot.service'
#alias starts='sudo systemctl start JohnBot.service'
#alias reloads='sudo systemctl daemon-reload'
[Unit]
Description=JohnBot service
# Wait for the network before starting
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
# Set the user, directory, and node start command
User=johnk
WorkingDirectory=/home/johnk/JohnBot2
ExecStart=/usr/bin/npm start
Restart=always
[Install]
WantedBy=multi-user.target