diff options
author | Dmitry Bogatov <KAction@gnu.org> | 2016-08-14 08:59:18 +0300 |
---|---|---|
committer | Dmitry Bogatov <KAction@gnu.org> | 2016-08-14 08:59:18 +0300 |
commit | 145adc0ad85434e92eaf3180dbda80c57e1417dc (patch) | |
tree | da449aad8982d305accb5df0e92770391870740d /dh_runit | |
parent | d912ba4f2edbcd72c4750222e9870fb10b95b874 (diff) |
Fix attempt to create directory under /
Diffstat (limited to 'dh_runit')
-rwxr-xr-x | dh_runit | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -81,16 +81,14 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { | |||
81 | runit_autoscript($pkg, 'postrm', "s/#NAME#/$name/"); | 81 | runit_autoscript($pkg, 'postrm', "s/#NAME#/$name/"); |
82 | if ($conf->{logscript}) { | 82 | if ($conf->{logscript}) { |
83 | my $logdir = $conf->{logdir} || "/var/log/runit/$name"; | 83 | my $logdir = $conf->{logdir} || "/var/log/runit/$name"; |
84 | $logdir = "$tmp/$logdir"; | ||
85 | 84 | ||
86 | install_dir("$sv_dir/$name/log"); | 85 | install_dir("$sv_dir/$name/log"); |
87 | install_dir($logdir); | 86 | install_dir($tmp . $logdir); |
88 | 87 | ||
89 | my $run_log = "$sv_dir/$name/log/run"; | 88 | my $run_log = "$sv_dir/$name/log/run"; |
90 | my $log_user = $name . "log_"; | 89 | my $log_user = $name . "log_"; |
91 | open(RUN_LOG, ">$run_log") || die $!; | 90 | open(RUN_LOG, ">$run_log") || die $!; |
92 | print RUN_LOG "#!/bin/sh\n"; | 91 | print RUN_LOG "#!/bin/sh\n"; |
93 | print RUN_LOG "mkdir -p '$logdir'\n"; | ||
94 | print RUN_LOG "chown -R '$log_user' '$logdir'\n"; | 92 | print RUN_LOG "chown -R '$log_user' '$logdir'\n"; |
95 | print RUN_LOG "exec chpst -u '$log_user' svlogd -tt '$logdir'\n"; | 93 | print RUN_LOG "exec chpst -u '$log_user' svlogd -tt '$logdir'\n"; |
96 | close(RUN_LOG); | 94 | close(RUN_LOG); |