From d854fffc6d6ed2360162087328ccb7ce867331fc Mon Sep 17 00:00:00 2001 From: larsen0815 Date: Fri, 9 Jan 2026 14:15:26 +0100 Subject: [PATCH 1/4] Enable and start services after DEB installation --- build/fpm-piler-after-install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/fpm-piler-after-install.sh b/build/fpm-piler-after-install.sh index 62b75885..a06905bb 100755 --- a/build/fpm-piler-after-install.sh +++ b/build/fpm-piler-after-install.sh @@ -139,18 +139,26 @@ fi if [[ -f /usr/libexec/piler/piler.service ]]; then ln -sf /usr/libexec/piler/piler.service /lib/systemd/system + /usr/bin/systemctl enable piler.service + /usr/bin/systemctl start piler.service fi if [[ -f /usr/libexec/piler/piler-smtp.service ]]; then ln -sf /usr/libexec/piler/piler-smtp.service /lib/systemd/system + /usr/bin/systemctl enable piler-smtp.service + /usr/bin/systemctl start piler-smtp.service fi if [[ -f /usr/libexec/piler/pilersearch.service ]]; then ln -sf /usr/libexec/piler/pilersearch.service /lib/systemd/system + /usr/bin/systemctl enable pilersearch.service + /usr/bin/systemctl start pilersearch.service fi if [[ -f /usr/libexec/piler/tika.service ]]; then ln -sf /usr/libexec/piler/tika.service /lib/systemd/system + /usr/bin/systemctl enable tika.service + /usr/bin/systemctl start tika.service fi if [[ $(pgrep -c systemd) -gt 0 && -x /bin/systemctl ]]; then From e3002c0a4552b50401283847c44de11d63ba9791 Mon Sep 17 00:00:00 2001 From: larsen0815 Date: Sat, 10 Jan 2026 20:41:44 +0100 Subject: [PATCH 2/4] systemctl: Use "enable --now" instead of separate "start" command --- build/fpm-piler-after-install.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/build/fpm-piler-after-install.sh b/build/fpm-piler-after-install.sh index a06905bb..ab8df5a0 100755 --- a/build/fpm-piler-after-install.sh +++ b/build/fpm-piler-after-install.sh @@ -139,26 +139,22 @@ fi if [[ -f /usr/libexec/piler/piler.service ]]; then ln -sf /usr/libexec/piler/piler.service /lib/systemd/system - /usr/bin/systemctl enable piler.service - /usr/bin/systemctl start piler.service + /usr/bin/systemctl enable --now piler.service fi if [[ -f /usr/libexec/piler/piler-smtp.service ]]; then ln -sf /usr/libexec/piler/piler-smtp.service /lib/systemd/system - /usr/bin/systemctl enable piler-smtp.service - /usr/bin/systemctl start piler-smtp.service + /usr/bin/systemctl enable --now piler-smtp.service fi if [[ -f /usr/libexec/piler/pilersearch.service ]]; then ln -sf /usr/libexec/piler/pilersearch.service /lib/systemd/system - /usr/bin/systemctl enable pilersearch.service - /usr/bin/systemctl start pilersearch.service + /usr/bin/systemctl enable --now pilersearch.service fi if [[ -f /usr/libexec/piler/tika.service ]]; then ln -sf /usr/libexec/piler/tika.service /lib/systemd/system - /usr/bin/systemctl enable tika.service - /usr/bin/systemctl start tika.service + /usr/bin/systemctl enable --now tika.service fi if [[ $(pgrep -c systemd) -gt 0 && -x /bin/systemctl ]]; then From c476eb8631f3960894b03b3efb25584102ba7a62 Mon Sep 17 00:00:00 2001 From: larsen0815 Date: Mon, 19 Jan 2026 14:52:19 +0100 Subject: [PATCH 3/4] Bugfix: Enable services only after daemon-reload has been run, otherwise they will be unknown to systemd --- build/fpm-piler-after-install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build/fpm-piler-after-install.sh b/build/fpm-piler-after-install.sh index ab8df5a0..8c78e1e4 100755 --- a/build/fpm-piler-after-install.sh +++ b/build/fpm-piler-after-install.sh @@ -139,28 +139,30 @@ fi if [[ -f /usr/libexec/piler/piler.service ]]; then ln -sf /usr/libexec/piler/piler.service /lib/systemd/system - /usr/bin/systemctl enable --now piler.service fi if [[ -f /usr/libexec/piler/piler-smtp.service ]]; then ln -sf /usr/libexec/piler/piler-smtp.service /lib/systemd/system - /usr/bin/systemctl enable --now piler-smtp.service fi if [[ -f /usr/libexec/piler/pilersearch.service ]]; then ln -sf /usr/libexec/piler/pilersearch.service /lib/systemd/system - /usr/bin/systemctl enable --now pilersearch.service fi if [[ -f /usr/libexec/piler/tika.service ]]; then ln -sf /usr/libexec/piler/tika.service /lib/systemd/system - /usr/bin/systemctl enable --now tika.service fi if [[ $(pgrep -c systemd) -gt 0 && -x /bin/systemctl ]]; then systemctl daemon-reload fi +for i in piler piler-smtp pilersearch tika; do + if [[ -f "/lib/systemd/system/${i}.service" ]]; then + /usr/bin/systemctl enable --now "${i}.service" + fi +done + if [[ -f /var/piler/www/config.php ]]; then PILER_VERSION="$( piler -v )" for f in /var/piler/www/config.php /var/piler/www/vue/Footer.vue; do From f1a1bc8a18b68e3bb7899c047d8ea9de0773ea80 Mon Sep 17 00:00:00 2001 From: larsen0815 Date: Tue, 27 Jan 2026 17:13:24 +0100 Subject: [PATCH 4/4] Restart services after completing the postinstall script --- util/postinstall.sh.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/postinstall.sh.in b/util/postinstall.sh.in index 4f492e43..5051da8a 100755 --- a/util/postinstall.sh.in +++ b/util/postinstall.sh.in @@ -460,6 +460,17 @@ webui_install() { } +restart_services() { + echo; echo "Restarting services."; echo + + for i in piler piler-smtp pilersearch tika; do + if [[ -f "/lib/systemd/system/${i}.service" ]]; then + /usr/bin/systemctl restart "${i}.service" + fi + done +} + + clean_up_temp_stuff() { rm -f "$CRON_TMP" @@ -485,5 +496,6 @@ make_new_key show_summary execute_post_install_tasks +restart_services clean_up_temp_stuff