Merge pull request #297 from maximesrd/patch-8

Added startup script for openrc
This commit is contained in:
Baptiste Gelez 2018-10-29 19:35:57 +01:00 committed by GitHub
commit 6efcba46ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -494,6 +494,54 @@ exit 0
```
Now start the services:
```bash
service plume.service start
```
And check:
```bash
service plume.service status
```
## OpenRC integration
This script can also be useful if you are using OpenRC.
```bash
#! /sbin/openrc-run
name="plume"
description="plume : federated blogging"
pidfile=/run/plume
start() {
ebegin "Starting plume"
start-stop-daemon -v --start --exec "/home/plume/.cargo/bin/cargo run" --user "plume" --chdir "/home/plume/Plume" --background --stdout "/var/log/plume.log" --stderr "/var/log/plume.err" --make-pidfile --pidfile "/run/plume" -- "phx.server"
eend $?
}
stop() {
ebegin "Stopping plume"
start-stop-daemon --stop --user "plume" --chdir "/home/plume/Plume" --pidfile "/run/plume"
eend $?
}
```
Now you need to enable all of these services:
```bash
rc-update add plume
```
Now start the services:
```bash
/etc/init.d/plume start
```
## Caveats:
- Pgbouncer is not supported yet (named transactions are used).