mirror of
https://github.com/YGGverse/Pulsar.git
synced 2026-03-31 17:55:37 +00:00
add systemd config example
This commit is contained in:
parent
63ec2df6b0
commit
07307d6676
1 changed files with 31 additions and 0 deletions
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
|
* `config` - relative (`config` folder) or absolute path to configuration file
|
||||||
* `protocol` - server protocol, supported options:
|
* `protocol` - server protocol, supported options:
|
||||||
* `nex` - [NEX Protocol](https://nightfall.city/nex/info/specification.txt)
|
* `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…
Add table
Add a link
Reference in a new issue