mirror of
https://github.com/YGGverse/Pulsar.git
synced 2025-03-13 05:41:21 +00:00
add systemd config example
This commit is contained in:
parent
63ec2df6b0
commit
07307d6676
31
README.md
31
README.md
@ -37,3 +37,34 @@ Launch as many servers as wanted, for different protocols and configurations (pr
|
||||
* `config` - relative (`config` folder) or absolute path to configuration file
|
||||
* `protocol` - server protocol, supported options:
|
||||
* `nex` - [NEX Protocol](https://nightfall.city/nex/info/specification.txt)
|
||||
|
||||
### Autostart
|
||||
|
||||
#### systemd
|
||||
|
||||
Launch server as the systemd service
|
||||
|
||||
Following example mean application installed into the home directory of `pulsar` user (`useradd -m pulsar`)
|
||||
|
||||
``` pulsar.service
|
||||
# /etc/systemd/system/pulsar.service
|
||||
|
||||
[Unit]
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=pulsar
|
||||
Group=pulsar
|
||||
ExecStart=/usr/bin/php /home/pulsar/Pulsar/src/server.php protocol=nex config=name.json
|
||||
StandardOutput=file:/home/pulsar/debug.log
|
||||
StandardError=file:/home/pulsar/error.log
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
* `sudo systemctl daemon-reload` - reload systemd configuration
|
||||
* `sudo systemctl enable pulsar` - enable service on system startup
|
||||
* `sudo systemctl start pulsar` - start server
|
||||
|
Loading…
x
Reference in New Issue
Block a user