mirror of
https://github.com/etesync/server
synced 2024-11-22 08:48:07 +00:00
Created a short page on how to create a systemd unit for uWSGI
parent
a43003bdc9
commit
b7f8b6df3b
31
Run-uWSGI-at-boot.md
Normal file
31
Run-uWSGI-at-boot.md
Normal file
@ -0,0 +1,31 @@
|
||||
Having to run uWSGI manually is annoying and not maintainable.
|
||||
Instead, you should have `systemd` automatically start it at boot for you.
|
||||
|
||||
We can have `systemd` handle lauching uWSGI by creating a unit file for it.
|
||||
Create a new file called `etesync_server.service` and paste in the following.
|
||||
Don't forget to set the correct path to your installation.
|
||||
If you don't use a `.ini` file, pass flags here to your uWSGI.
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Execute the etesync server.
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/uwsgi --ini /path/to/server-skeleton/uwsgi.ini
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Next, copy this to `/etc/systemd/system`.
|
||||
`systemd` should now be able to start it.
|
||||
By also enabling it, it will launch at boot.
|
||||
|
||||
```
|
||||
cp etesync_server.service /etc/systemd/system
|
||||
sudo systemd start etesync_server
|
||||
sudo systemd enable etesync_server
|
||||
```
|
||||
|
||||
Check to see if it worked!
|
||||
If it didn't work, use the command `sudo systemd status etesync_server` to see what went wrong.
|
Loading…
Reference in New Issue
Block a user