Added startup script for openrc

This commit is contained in:
maximesrd 2018-10-29 12:39:14 +01:00 committed by GitHub
parent 0bb2e6293a
commit ae4c7e559c
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: ## Caveats:
- Pgbouncer is not supported yet (named transactions are used). - Pgbouncer is not supported yet (named transactions are used).