summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/user_scandir/log/run.epp19
-rw-r--r--templates/user_scandir/run.epp18
2 files changed, 37 insertions, 0 deletions
diff --git a/templates/user_scandir/log/run.epp b/templates/user_scandir/log/run.epp
new file mode 100644
index 0000000..797688c
--- /dev/null
+++ b/templates/user_scandir/log/run.epp
@@ -0,0 +1,19 @@
+<%- |
+ String $username,
+| -%>
+<% if versioncmp( $facts['os']['release']['major'], '10' ) >= 1 { -%>
+#!/usr/bin/execlineb -P
+<% } else { -%>
+#!/usr/local/bin/execlineb -P
+<% } -%>
+
+define SVUSER <%= $username %>
+define SVLOGDIR /var/log/s6/user_scandir_${SVUSER}/logs/
+
+fdmove -c 2 1
+s6-log
+ t
+ s1048576
+ S2147483648
+ !"mail -s \"user_sv log: ${SVUSER}\" -- root"
+ ${SVLOGDIR}
diff --git a/templates/user_scandir/run.epp b/templates/user_scandir/run.epp
new file mode 100644
index 0000000..8ef9d47
--- /dev/null
+++ b/templates/user_scandir/run.epp
@@ -0,0 +1,18 @@
+<% |
+ String $username,
+| -%>
+<% if versioncmp( $facts['os']['release']['major'], '10' ) >= 1 { -%>
+#!/usr/bin/execlineb -P
+<% } else { -%>
+#!/usr/local/bin/execlineb -P
+<% } -%>
+
+define USER <%= $username %>
+backtick HOME { homeof ${USER} }
+importas -n -u HOME HOME
+define SVDIR ${HOME}/.s6-scandir
+
+fdmove -c 2 1
+
+s6-setuidgid ${USER}
+s6-svscan -c 20 ${SVDIR}