forked from baudneo/zomi-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mlapi.service
38 lines (32 loc) · 1.08 KB
/
mlapi.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
## This is a systemd startup file if you are on a system that
## supports systemd and you want ZoMi Server to work as an always
## on service
## To make this persistent
# sudo cp mlapi.service /etc/systemd/system
# sudo chmod 644 /etc/systemd/system/mlapi.service
# sudo systemctl daemon-reload
## Add --now to the enable command to also start the server
# sudo systemctl enable mlapi.service --now
## To start,
# sudo systemctl start mlapi
## CHANGE User and ExecStart (if needed) to match your system!
[Unit]
Description=ZoMi ML API service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=5
# We need this to get logs correctly
Environment=PYTHONUNBUFFERED=1
# These 2 lines stop the console output being forwarded to syslog
# You can enable syslog logging in client config if you want
StandardOutput=null
StandardError=null
# Change to the user that the server was installed for
User=myusername
# Change config file path to match your system, if needed.
ExecStart=/usr/local/bin/mlapi -C /opt/zomi/server/conf/server.yml
[Install]
WantedBy=multi-user.target