summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorHendrik Jäger <gitcommit@henk.geekmail.org>2022-07-01 22:15:04 +0200
committerHendrik Jäger <gitcommit@henk.geekmail.org>2022-07-01 22:25:22 +0200
commite1c6349ec0d9aa6cb7d1690edf0416ddd3709d8a (patch)
treee443185df7b20f11ab83f81057f5951c5ec0e49e /templates
parentbfc65b39a1c85b67c44817cadb6de2a2fb2505a0 (diff)
refactor
Diffstat (limited to 'templates')
-rw-r--r--templates/etc/s6-services/irc-services/log/run.epp20
-rw-r--r--templates/etc/s6-services/irc-services/run.epp18
2 files changed, 38 insertions, 0 deletions
diff --git a/templates/etc/s6-services/irc-services/log/run.epp b/templates/etc/s6-services/irc-services/log/run.epp
new file mode 100644
index 0000000..60f5e08
--- /dev/null
+++ b/templates/etc/s6-services/irc-services/log/run.epp
@@ -0,0 +1,20 @@
+<%- |
+ String $network_name,
+| -%>
+<% if versioncmp( $facts['os']['release']['major'], '10' ) >= 1 { -%>
+#!/usr/bin/execlineb -P
+<% } else { -%>
+#!/usr/local/bin/execlineb -P
+<% } -%>
+
+define NETWORK_NAME <%= $network_name %>
+define SERVICES_LOGDIR /var/log/s6/irc-services-${NETWORK_NAME}
+define SERVICES_MAIL_FIFO ${SERVICES_LOGDIR}/mail_fifo
+
+fdmove -c 2 1
+s6-log
+ t
+ s1048576
+ S2147483648
+ !"background { redirfd -r 0 ${SERVICES_MAIL_FIFO} mail -s \"irc-services log: ${NETWORK_NAME}\" -- root } tee ${SERVICES_MAIL_FIFO}"
+ "${SERVICES_LOGDIR}/logs"
diff --git a/templates/etc/s6-services/irc-services/run.epp b/templates/etc/s6-services/irc-services/run.epp
new file mode 100644
index 0000000..ddac6e2
--- /dev/null
+++ b/templates/etc/s6-services/irc-services/run.epp
@@ -0,0 +1,18 @@
+<%- |
+ String $network_name,
+ String $run_user,
+| -%>
+<% if versioncmp( $facts['os']['release']['major'], '10' ) >= 1 { -%>
+#!/usr/bin/execlineb -P
+<% } else { -%>
+#!/usr/local/bin/execlineb -P
+<% } -%>
+
+define NETWORK_NAME <%= $network_name %>
+define RUN_USER <%= $run_user %>
+backtick HOME { homeof ${RUN_USER} }
+importas -n -u HOME HOME
+
+fdmove -c 2 1
+s6-setuidgid ${RUN_USER}
+${HOME}/rundir/anope/current/bin/services --nofork