diff options
author | Dmitry Bogatov <KAction@gnu.org> | 2017-03-02 12:50:14 +0300 |
---|---|---|
committer | Dmitry Bogatov <KAction@gnu.org> | 2017-03-02 12:50:14 +0300 |
commit | fb23e1628d4951088c8a2ae8447f6b0dca4ede34 (patch) | |
tree | f66c6e70ab2b183c8720230cfa735f2313df584b | |
parent | 166e985e2d98b25ee47301c9e16be03460ba13bb (diff) |
Improve readability of code, generating /etc/sv/<daemon>/log/run script using here-doc notation.
-rw-r--r-- | debian/changelog | 2 | ||||
-rwxr-xr-x | dh_runit | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 35d47a1..b55583b 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -3,6 +3,8 @@ dh-runit (1.6.3) UNRELEASED; urgency=medium | |||
3 | * Change naming of generated system users for logging to start | 3 | * Change naming of generated system users for logging to start |
4 | with underscore. | 4 | with underscore. |
5 | * Add missing dependency on dh-sysuser. | 5 | * Add missing dependency on dh-sysuser. |
6 | * Improve readability of code, generating /etc/sv/<daemon>/log/run | ||
7 | script using here-doc notation. | ||
6 | 8 | ||
7 | -- Dmitry Bogatov <KAction@gnu.org> Wed, 01 Mar 2017 18:38:17 +0300 | 9 | -- Dmitry Bogatov <KAction@gnu.org> Wed, 01 Mar 2017 18:38:17 +0300 |
8 | 10 | ||
@@ -87,9 +87,11 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { | |||
87 | my $run_log = "$sv_dir/$name/log/run"; | 87 | my $run_log = "$sv_dir/$name/log/run"; |
88 | my $log_user = "_log-". $name; | 88 | my $log_user = "_log-". $name; |
89 | open(RUN_LOG, ">$run_log") || die $!; | 89 | open(RUN_LOG, ">$run_log") || die $!; |
90 | print RUN_LOG "#!/bin/sh\n"; | 90 | print RUN_LOG << "HERE"; |
91 | print RUN_LOG "chown -R '$log_user' '$logdir'\n"; | 91 | #!/bin/sh |
92 | print RUN_LOG "exec chpst -u '$log_user' svlogd -tt '$logdir'\n"; | 92 | chown -R '$log_user' '$logdir' |
93 | exec chpst -u '$log_user' svlogd -tt '$logdir' | ||
94 | HERE | ||
93 | close(RUN_LOG); | 95 | close(RUN_LOG); |
94 | chmod(0755, $run_log); | 96 | chmod(0755, $run_log); |
95 | doit('dh_sysuser', '-p', $pkg, $log_user, 'defaults'); | 97 | doit('dh_sysuser', '-p', $pkg, $log_user, 'defaults'); |