From 853ae88d3f38e4293e4bec41d9e689aa9c73b13c Mon Sep 17 00:00:00 2001 From: Azlux Date: Wed, 5 Feb 2020 14:47:31 +0100 Subject: [PATCH] rollback #83 --- debian/postinst | 10 ++++++++-- debian/preinst | 3 ++- debian/prerm | 12 +++++++++++- log2ram.service | 1 - 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/debian/postinst b/debian/postinst index 91c9dd7..e02a1b0 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,6 +1,12 @@ #!/usr/bin/env bash set -euo pipefail +systemctl daemon-reload systemctl enable log2ram -echo "##### Reboot to activate log2ram #####" -echo "##### edit /etc/log2ram.conf to configure options ####" + +if [ "$1" == "configure" ]; then + echo "##### Reboot to activate log2ram #####" + echo "##### edit /etc/log2ram.conf to configure options ####" +fi + +exit 0 diff --git a/debian/preinst b/debian/preinst index 586f927..1be8859 100755 --- a/debian/preinst +++ b/debian/preinst @@ -1,5 +1,6 @@ #!/bin/bash -set -euo pipefail systemctl -q is-active log2ram && systemctl stop log2ram rm -rf /var/hdd.log + +exit 0 diff --git a/debian/prerm b/debian/prerm index 7b84e1e..364a442 100755 --- a/debian/prerm +++ b/debian/prerm @@ -1,2 +1,12 @@ #!/usr/bin/env bash -systemctl stop log2ram.service +case "$1" in + upgrade) + [ -d /run/systemd/system/ ] && systemctl stop log2ram + exit 0 + ;; + *) + [ -d /run/systemd/system/ ] && systemctl stop log2ram + [ -d /run/systemd/system/ ] && systemctl disable log2ram + exit 0 + ;; +esac diff --git a/log2ram.service b/log2ram.service index c6b4497..f07bbb5 100644 --- a/log2ram.service +++ b/log2ram.service @@ -17,4 +17,3 @@ RemainAfterExit=yes [Install] WantedBy=sysinit.target -RequiredBy=systemd-journald.service