diff options
-rwxr-xr-x | dh_runit | 3 | ||||
-rw-r--r-- | postinst-runit | 23 | ||||
-rw-r--r-- | prerm-runit | 1 |
3 files changed, 26 insertions, 1 deletions
@@ -90,7 +90,8 @@ PKG: foreach my $pkg (@{$dh{DOPACKAGES}}) { | |||
90 | doit('cp', '-r', $path, "$sv_dir/$name"); | 90 | doit('cp', '-r', $path, "$sv_dir/$name"); |
91 | } | 91 | } |
92 | if ($enable -eq 'enable' && !$DH{NO_ENABLE}) { | 92 | if ($enable -eq 'enable' && !$DH{NO_ENABLE}) { |
93 | autoscript($pkg, 'postinst', 'postinst-runit', "s/#NAME#/$name/"); | ||
93 | } | 94 | } |
95 | autoscript($pkg, 'prerm', 'prerm-runit', "s/#NAME#/$name/"); | ||
94 | } | 96 | } |
95 | } | 97 | } |
96 | |||
diff --git a/postinst-runit b/postinst-runit index e69de29..3a51832 100644 --- a/postinst-runit +++ b/postinst-runit | |||
@@ -0,0 +1,23 @@ | |||
1 | SV_ABS_DIR=/var/lib/runit/service | ||
2 | SV_DIR=/etc/service | ||
3 | mkdir -p "$SV_ABS_DIR" | ||
4 | if [ ! -e "$SV_DIR" ] ; then | ||
5 | ln -s "$SV_ABS_DIR" "$SV_DIR" | ||
6 | fi | ||
7 | |||
8 | if [ "$(readlink -f "$SV_DIR")" != "$SV_ABS_DIR" ] ; then | ||
9 | cat <<EOF | ||
10 | Service directory '$SV_DIR' exists, but is not symbolic link | ||
11 | to '$SV_ABS_DIR'. It probably means that it was created by | ||
12 | hand or versions of runit below 2.1.2-4. | ||
13 | |||
14 | In either case, please remove service directory yourself and | ||
15 | restart installation. | ||
16 | EOF | ||
17 | exit 1 | ||
18 | fi | ||
19 | NAME=#NAME# | ||
20 | ln -s "/etc/sv/$NAME" "$SV_DIR/$NAME" | ||
21 | |||
22 | |||
23 | |||
diff --git a/prerm-runit b/prerm-runit index e69de29..8dfa6b6 100644 --- a/prerm-runit +++ b/prerm-runit | |||
@@ -0,0 +1 @@ | |||
rm -f /etc/service/#NAME# \ No newline at end of file | |||