diff -pruN 2.13.1/data/finish 2.14.1/data/finish
--- 2.13.1/data/finish	2022-04-11 01:26:46.000000000 +0000
+++ 2.14.1/data/finish	2022-06-16 14:45:15.000000000 +0000
@@ -1,4 +1,4 @@
 #!/bin/sh
 set -e
 
-. /lib/runit/finish-default "$@"
+exec /lib/runit/finish-exec "$@"
diff -pruN 2.13.1/debian/changelog 2.14.1/debian/changelog
--- 2.13.1/debian/changelog	2022-05-15 00:26:43.000000000 +0000
+++ 2.14.1/debian/changelog	2022-08-01 22:38:33.000000000 +0000
@@ -1,3 +1,30 @@
+dh-runit (2.14.1) unstable; urgency=medium
+
+  * Avoid spurious warning during postinstall
+  * Move metafiles inside the service directory
+  * Remove supervise symlinks at postrm
+  * Upload to unstable
+
+ -- Lorenzo Puliti <plorenzo@disroot.org>  Tue, 02 Aug 2022 00:38:33 +0200
+
+dh-runit (2.14.0) experimental; urgency=medium
+
+  * Stop creating supervise links as part of
+     the deb package (Closes: #942053)
+  * Create supervise links at runtime with make_svlinks,
+     but only when runit package is installed
+     (Closes: #935939)
+  * Use finish-exec instead of finish-default
+  * Bump minimal required version of runit and runit-helper
+  * Do not install the log service with usr option
+  * Error when log service already exists and logscript
+     option is given
+  * Update testsuite
+  * Temporary disable ghc testsuite, libghc-shake-dev
+     is not installable in Sid
+
+ -- Lorenzo Puliti <plorenzo@disroot.org>  Sat, 02 Jul 2022 12:09:54 +0200
+
 dh-runit (2.13.1) unstable; urgency=medium
 
   * Add ${perl:Depends} to dh-runit depends
diff -pruN 2.13.1/debian/control 2.14.1/debian/control
--- 2.13.1/debian/control	2022-05-15 00:24:59.000000000 +0000
+++ 2.14.1/debian/control	2022-08-01 17:35:30.000000000 +0000
@@ -9,7 +9,8 @@ Build-Depends:
  libfile-copy-recursive-perl,
  libtext-hogan-perl,
  libfile-slurp-perl,
- libghc-shake-dev,
+# not installable in Sid #1013886
+# libghc-shake-dev,
 Standards-Version: 4.6.1
 Rules-Requires-Root: no
 Vcs-Browser: https://salsa.debian.org/debian/dh-runit
diff -pruN 2.13.1/debian/tests/control 2.14.1/debian/tests/control
--- 2.13.1/debian/tests/control	2022-05-06 19:02:25.000000000 +0000
+++ 2.14.1/debian/tests/control	2022-08-01 17:35:30.000000000 +0000
@@ -1,6 +1,7 @@
-Test-Command: make autopkgtest
-Depends: @, libghc-shake-dev
-Architecture: amd64, arm64, i386
+# libghc-shake-dev not installable in Sid
+# Test-Command: make autopkgtest
+# Depends: @, libghc-shake-dev
+# Architecture: amd64, arm64, i386
 
 Tests: helper-update-rc.d
 Depends: runit-helper
diff -pruN 2.13.1/dh_runit 2.14.1/dh_runit
--- 2.13.1/dh_runit	2022-05-15 00:26:43.000000000 +0000
+++ 2.14.1/dh_runit	2022-08-01 22:38:33.000000000 +0000
@@ -13,7 +13,7 @@ use File::Copy::Recursive qw(dircopy);
 use feature 'signatures';
 no warnings 'experimental';
 
-our $VERSION = "2.13.1";
+our $VERSION = "2.14.1";
 
 # Create empty file {dest} and all required parent directories.
 sub create_empty_file {
@@ -121,7 +121,9 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}
         }
 
         my $sv_dir = "$tmp/etc/sv" unless ($conf->{usr});
+        my $meta_dir = "$tmp/usr/share/runit/meta" unless ($conf->{usr});
         $sv_dir = "$tmp/usr/share/runit/sv" if ($conf->{usr}) ;
+        $meta_dir = "$tmp/usr/share/runit/sv/$name/.meta" if ($conf->{usr}) ;
         my $finish ="$sv_dir/$name/finish";
 
         my @upgrades = ("restart", "stop", "nostop", "reload");
@@ -131,7 +133,8 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}
         }
 
         if ($conf->{onupgrade} eq 'nostop' || $conf->{onupgrade} eq 'reload') {
-            create_empty_file("${tmp}/usr/share/runit/meta/${name}/noreplace");
+            create_empty_file("${tmp}/usr/share/runit/meta/${name}/noreplace"); # to be removed
+            create_empty_file("$meta_dir/noreplace");
         }
 
         #Metafiles:
@@ -163,19 +166,21 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}
         }
 
         if ($conf->{logscript}) {
-            create_empty_file("${tmp}/usr/share/runit/meta/${name}/logscript") if ($conf->{usr});
             my $logdir = "/var/log/runit/$name";
-
-            install_dir("$sv_dir/$name/log");
-            install_dir($tmp . $logdir);
-
-            template_from_data_directory('logscript', "$sv_dir/$name/log/run",
+            if (-e "$sv_dir/$name/log/run") {
+                error("logscript option but log/run already exists");
+	    }
+	        elsif  ($conf->{usr}) {
+	        create_empty_file("${tmp}/usr/share/runit/meta/${name}/logscript"); # to be removed
+	        create_empty_file("$meta_dir/logscript");
+	        install_dir("$sv_dir/$name/log");
+	    }
+                else {
+                install_dir("$sv_dir/$name/log");
+                install_dir($tmp . $logdir);
+                template_from_data_directory('logscript', "$sv_dir/$name/log/run",
                                          { logdir => $logdir }, 0755);
-        }
-
-        make_symlink("/etc/sv/$name/supervise", "/run/runit/supervise/$name", $tmp) unless ($conf->{usr});
-        if ( -e "$sv_dir/$name/log/run") {
-            make_symlink("/etc/sv/$name/log/supervise", "/run/runit/supervise/$name.log", $tmp) unless ($conf->{usr});
+	    }
         }
 
         my $substitutions = {
@@ -184,14 +189,18 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}
             ONUPGRADE => $conf->{onupgrade}
         };
         if ($conf->{noscripts}) {
-            create_empty_file("${tmp}/usr/share/runit/meta/${name}/noscripts");
+            create_empty_file("${tmp}/usr/share/runit/meta/${name}/noscripts"); # to be removed
+            create_empty_file("$meta_dir/noscripts");
             #service enable/disable and upgrade action
-            write_file("${tmp}/usr/share/runit/meta/${name}/onupgrade", $conf->{onupgrade});
+            write_file("${tmp}/usr/share/runit/meta/${name}/onupgrade", $conf->{onupgrade}); # to be removed
+            write_file("$meta_dir/onupgrade", $conf->{onupgrade});
             if ($conf->{enable}) {
-                write_file("${tmp}/usr/share/runit/meta/${name}/enable", 'yes');
+                write_file("${tmp}/usr/share/runit/meta/${name}/enable", 'yes'); #to be removed
+                write_file("$meta_dir/enable", 'yes');
 	    }
 	        else {
-	        write_file("${tmp}/usr/share/runit/meta/${name}/enable", 'no');
+	        write_file("${tmp}/usr/share/runit/meta/${name}/enable", 'no'); # to be removed
+	        write_file("$meta_dir/enable", 'no')
             }
         }
             else {
@@ -227,9 +236,11 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}
     # runit-helper 2.8.15 use dotlinks to mark a service as disabled, 'since' option is deprecated
     # runit-helper 2.9.0 has code for loguser transition
     # dh-runit 2.10.0 introduce the 'onupgrade' option that needs support in runit-helper
-    addsubstvar($pkg, 'runit:Conflicts', 'runit', '<< 2.1.2-36~');
-    addsubstvar($pkg, 'runit:Breaks', 'runit', '<< 2.1.2-36~');
-    addsubstvar($pkg, 'misc:Depends', 'runit-helper', '>= 2.10.0~');
+    # runit 2.1.2-46 introduces /lib/runit/make_svlinks
+    # runit-helper 2.14.0 calls make_svlinks in postinst
+    addsubstvar($pkg, 'runit:Conflicts', 'runit', '<< 2.1.2-46~');
+    addsubstvar($pkg, 'runit:Breaks', 'runit', '<< 2.1.2-46~');
+    addsubstvar($pkg, 'misc:Depends', 'runit-helper', '>= 2.14.0~');
 }
 
 # PROMISE: DH NOOP WITHOUT runit
diff -pruN 2.13.1/Makefile 2.14.1/Makefile
--- 2.13.1/Makefile	2020-03-18 18:51:54.000000000 +0000
+++ 2.14.1/Makefile	2022-08-01 17:35:30.000000000 +0000
@@ -1,8 +1,9 @@
 all:
 testrunner: testrunner.hs
 	ghc $<
-check: testrunner
-	./testrunner
+check:
+#check: testrunner
+#	./testrunner
 autopkgtest: testrunner
 	AUTOPKGTEST=1 ./testrunner
 .PHONY: check
diff -pruN 2.13.1/runit-helper 2.14.1/runit-helper
--- 2.13.1/runit-helper	2022-04-12 15:44:39.000000000 +0000
+++ 2.14.1/runit-helper	2022-08-01 22:38:33.000000000 +0000
@@ -46,6 +46,12 @@ ok_pipe () {
 postinst () {
 	local action="${1}" previous="${2:-}"
 
+	# create supervise links at runtime, only if runit is installed
+	mkdir -p /run/runit/supervise
+	if [ -e /lib/runit/make_svlinks ]; then
+		/lib/runit/make_svlinks "$NAME"
+	fi
+
 	# loguser transition: to be removed when the transition is done 
 	# we do ths before enable to avoid races
 	# old loguser is 'runit-log', new is '_runit-log'
@@ -55,7 +61,7 @@ postinst () {
 		[ -f "/var/log/runit/$NAME/current" ] ; then
 		loguser="$(stat --format '%U' /var/log/runit/$NAME/current)"
 		if [ "${loguser}" = "runit-log" ]; then
-			sv d "/etc/sv/$NAME/log" >/dev/null || sv_warn
+			sv d "/etc/sv/$NAME/log" >/dev/null || true
 			chown _runit-log:adm /var/log/runit/$NAME/current
 			chown _runit-log:adm /var/log/runit/$NAME/lock
 		fi
@@ -82,7 +88,6 @@ postinst () {
 	#
 	# This code must be removed once there are no more packages with
 	# /etc/sv/{name}/supervise -> /var/lib/runit/supervise/{name}
-	mkdir -p /run/runit/supervise
 
 	old="/var/lib/runit/supervise/${NAME}" 
 	new="/run/runit/supervise/${NAME}"
@@ -100,8 +105,8 @@ postinst () {
 	# we do this after enable to reduce chance of races
 	if [ "${ENABLE}" = yes ] && \
 		[ -f "/etc/sv/$NAME/log/run" ] ; then
-		if is_installed ; then
-			sv u "/etc/sv/$NAME/log" >/dev/null || sv_warn
+		if is_installed && is_enabled ; then
+			sv u "/etc/sv/$NAME/log" >/dev/null || true
 		fi
 	fi
 
@@ -157,7 +162,9 @@ postrm () {
 	# in this directory, and `dpkg' will remove it. In this case,
 	# we have nothing to do.
 	for supervise in "/var/lib/runit/supervise/$NAME" \
-	                 "/var/lib/runit/log/supervise/$NAME" ; do
+	                 "/var/lib/runit/log/supervise/$NAME" \
+	                 "/etc/sv/$NAME/supervise" \
+	                 "/etc/sv/$NAME/log/supervise"; do
 		if [ -d "$supervise" ] ; then
 
 			# Actually only `down' may be absent, but it does not
@@ -174,7 +181,11 @@ postrm () {
 			#
 			# NOTE: Non-POSIX option is used. The day coreutils will
 			# no longer be essential, it will require a fix.
-			rmdir --ignore-fail-on-non-empty "$supervise"
+			if [ -h "$supervise" ]; then
+				rm "$supervise"
+			else
+				rmdir --ignore-fail-on-non-empty "$supervise"
+			fi
 		fi
 	done
 
diff -pruN 2.13.1/t/checks/977925-supervise-1/check 2.14.1/t/checks/977925-supervise-1/check
--- 2.13.1/t/checks/977925-supervise-1/check	2020-12-29 11:22:09.000000000 +0000
+++ 2.14.1/t/checks/977925-supervise-1/check	1970-01-01 00:00:00.000000000 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use warnings;
-use Test::More tests => 2;
-use File::stat;
-
-my $svdir = 'debian/dh-runit-test/etc/sv/test';
-ok(-l "${svdir}/supervise", "{svdir}/supervise link correctly setup");
-ok(-l "${svdir}/log/supervise", "{svdir}/log/supervise link correctly setup");
diff -pruN 2.13.1/t/checks/977925-supervise-1/debian/dh-runit-test.runit 2.14.1/t/checks/977925-supervise-1/debian/dh-runit-test.runit
--- 2.13.1/t/checks/977925-supervise-1/debian/dh-runit-test.runit	2020-12-29 10:40:23.000000000 +0000
+++ 2.14.1/t/checks/977925-supervise-1/debian/dh-runit-test.runit	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-debian/test.rundir name=test
diff -pruN 2.13.1/t/checks/977925-supervise-2/check 2.14.1/t/checks/977925-supervise-2/check
--- 2.13.1/t/checks/977925-supervise-2/check	2020-12-29 11:27:25.000000000 +0000
+++ 2.14.1/t/checks/977925-supervise-2/check	1970-01-01 00:00:00.000000000 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use warnings;
-use Test::More tests => 2;
-use File::stat;
-
-my $svdir = 'debian/dh-runit-test/etc/sv/test';
-ok(-l "${svdir}/supervise", "{svdir}/supervise link correctly setup");
-ok(! -l "${svdir}/log/supervise", "ok: {svdir}/log/supervise link not created");
diff -pruN 2.13.1/t/checks/977925-supervise-2/debian/dh-runit-test.runit 2.14.1/t/checks/977925-supervise-2/debian/dh-runit-test.runit
--- 2.13.1/t/checks/977925-supervise-2/debian/dh-runit-test.runit	2020-12-29 11:28:21.000000000 +0000
+++ 2.14.1/t/checks/977925-supervise-2/debian/dh-runit-test.runit	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-debian/test.runscript name=test
diff -pruN 2.13.1/t/checks/usr/check 2.14.1/t/checks/usr/check
--- 2.13.1/t/checks/usr/check	2022-04-11 01:26:46.000000000 +0000
+++ 2.14.1/t/checks/usr/check	2022-06-20 01:21:53.000000000 +0000
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use strict;
 use warnings;
-use Test::More tests => 8;
+use Test::More tests => 7;
 
 my $svrun = 'debian/dh-runit-test/usr/share/runit/sv/test/run';
 my $svdir = 'debian/dh-runit-test/etc/sv/test';
@@ -9,8 +9,7 @@ ok(-f $svrun, 'run file correctly create
 ok(-x $svrun, 'run file is executable');
 ok(! -d $svdir, 'service not created under /etc/sv/');
 my $svlog = 'debian/dh-runit-test/usr/share/runit/sv/test/log/run';
-ok(-f $svlog, 'logscript correctly created');
-ok(-x $svlog, 'logscript is executable');
+ok(! -f $svlog, 'log service not created');
 my $finish = 'debian/dh-runit-test/usr/share/runit/sv/test/finish';
 ok(-f $finish, 'finish file correctly created');
 ok(-x $finish, 'finish file is executable');
