diff options
author | Dmitry Bogatov <KAction@debian.org> | 2019-05-28 21:10:02 +0000 |
---|---|---|
committer | Dmitry Bogatov <KAction@debian.org> | 2019-05-28 21:30:40 +0000 |
commit | e4b8e832194949b228db4fd00eab558dfc8b7d27 (patch) | |
tree | a3a3dccdf1ba568686411f769857758372c33165 /data | |
parent | 8eddb040f95b7e6a2ebb4700c4518e76b7c5b294 (diff) |
Refactor creation of logscript
Instead of using interpolation and here-strings, write function that
renders mustache template. This approach makes code cleaner and more
scalable.
* data/logscript: add mustach template of 'log/run' script, that is
installed when "logscript" option in effect.
* Makefile: set DH_RUNIT_DATADIR variable in "check" target. This way,
templates from ./data/ directory are used, not from system location.
* debian/control: add dependency on Text::Hogan library --
implementation of "mustache" templating standard.
* dh_runit(template_from_data_directory): new function
* dh_runit: install 'log/run' with "template_from_data_directory"
function.
* t/928935.t: check that "logscript" option correctly creates
'log/run' script, with correct permissions.
Diffstat (limited to 'data')
-rw-r--r-- | data/logscript | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/data/logscript b/data/logscript new file mode 100644 index 0000000..1ebfb77 --- /dev/null +++ b/data/logscript | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | chown -R runit-log:adm '{{ logdir }}' | ||
3 | chmod 750 '{{ logdir }}' | ||
4 | chmod u+rw,g+r,o-rwx '{{ logdir }}'/* | ||
5 | exec chpst -u runit-log svlogd -tt '{{ logdir }}' | ||