diff --git a/distrib/s6/README b/distrib/s6/README new file mode 100644 index 00000000..e496a98c --- /dev/null +++ b/distrib/s6/README @@ -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/ diff --git a/distrib/s6/ergo-log/consumer-for b/distrib/s6/ergo-log/consumer-for new file mode 100644 index 00000000..1955a6f5 --- /dev/null +++ b/distrib/s6/ergo-log/consumer-for @@ -0,0 +1 @@ +ergo-srv diff --git a/distrib/s6/ergo-log/notification-fd b/distrib/s6/ergo-log/notification-fd new file mode 100644 index 00000000..00750edc --- /dev/null +++ b/distrib/s6/ergo-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/distrib/s6/ergo-log/pipeline-name b/distrib/s6/ergo-log/pipeline-name new file mode 100644 index 00000000..b57f1aa0 --- /dev/null +++ b/distrib/s6/ergo-log/pipeline-name @@ -0,0 +1 @@ +ergo diff --git a/distrib/s6/ergo-log/run b/distrib/s6/ergo-log/run new file mode 100644 index 00000000..bdda2ee6 --- /dev/null +++ b/distrib/s6/ergo-log/run @@ -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 diff --git a/distrib/s6/ergo-log/type b/distrib/s6/ergo-log/type new file mode 100644 index 00000000..5883cff0 --- /dev/null +++ b/distrib/s6/ergo-log/type @@ -0,0 +1 @@ +longrun diff --git a/distrib/s6/ergo-srv/producer-for b/distrib/s6/ergo-srv/producer-for new file mode 100644 index 00000000..c3430ce5 --- /dev/null +++ b/distrib/s6/ergo-srv/producer-for @@ -0,0 +1 @@ +ergo-log diff --git a/distrib/s6/ergo-srv/run b/distrib/s6/ergo-srv/run new file mode 100644 index 00000000..41218239 --- /dev/null +++ b/distrib/s6/ergo-srv/run @@ -0,0 +1,4 @@ +#!/usr/bin/execlineb -P +fdmove -c 2 1 +execline-cd /opt/ergo +s6-setuidgid ergo ./ergo run diff --git a/distrib/s6/ergo-srv/type b/distrib/s6/ergo-srv/type new file mode 100644 index 00000000..5883cff0 --- /dev/null +++ b/distrib/s6/ergo-srv/type @@ -0,0 +1 @@ +longrun diff --git a/distrib/s6/ergo.conf b/distrib/s6/ergo.conf new file mode 100644 index 00000000..60c88acf --- /dev/null +++ b/distrib/s6/ergo.conf @@ -0,0 +1,2 @@ +# This configures the directives used for s6-log in the log service. +DIRECTIVES="n3 s2000000"