3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-21 19:39:43 +01:00

add s6 services to distrib

This commit is contained in:
Jacob Moody 2021-08-28 18:14:47 -06:00
parent 9b6ec04ca5
commit 9f7ead07a5
No known key found for this signature in database
GPG Key ID: 05F36D0FA79A5F43
10 changed files with 29 additions and 0 deletions

8
distrib/s6/README Normal file
View File

@ -0,0 +1,8 @@
This directory contains s6 srv and log services for ergo.
These services expect that ergo is installed to /opt/ergo,
and an ergo system user that owns /opt/ergo.
To install:
cp -r ergo-srv ergo-log /etc/s6/sv/
cp ergo.conf /etc/s6/config/

View File

@ -0,0 +1 @@
ergo-srv

View File

@ -0,0 +1 @@
3

View File

@ -0,0 +1 @@
ergo

9
distrib/s6/ergo-log/run Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/execlineb -P
envfile /etc/s6/config/ergo.conf
importas -sCiu DIRECTIVES DIRECTIVES
ifelse { test -w /var/log } {
foreground { install -d -o s6log -g s6log /var/log/ergo }
s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /var/log/ergo
}
foreground { install -d -o s6log -g s6log /run/log/ergo }
s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /run/log/ergo

1
distrib/s6/ergo-log/type Normal file
View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
ergo-log

4
distrib/s6/ergo-srv/run Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/execlineb -P
fdmove -c 2 1
execline-cd /opt/ergo
s6-setuidgid ergo ./ergo run

1
distrib/s6/ergo-srv/type Normal file
View File

@ -0,0 +1 @@
longrun

2
distrib/s6/ergo.conf Normal file
View File

@ -0,0 +1,2 @@
# This configures the directives used for s6-log in the log service.
DIRECTIVES="n3 s2000000"