diff options
author | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2022-05-09 22:17:10 +0200 |
---|---|---|
committer | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2022-07-25 23:53:04 +0200 |
commit | 34e6a9d0ab678ac69218a6be995b73c87e47b17c (patch) | |
tree | e0436476216d87f0ff606c7474a3b946be9a2ada /templates | |
parent | b63cb7937892c18a9c3c6da6b06e0c9a5fe7b3a1 (diff) |
implement user scandirs
Diffstat (limited to 'templates')
-rw-r--r-- | templates/user_scandir/log/run.epp | 19 | ||||
-rw-r--r-- | templates/user_scandir/run.epp | 18 |
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} |