From 389458615e800731e71d394b57564fbedb65b13b Mon Sep 17 00:00:00 2001 From: leafee98 Date: Wed, 13 Dec 2023 17:19:28 +0800 Subject: [PATCH] add/update service restart postinst added/updated for dufs-bin, filebrowser-bin, forgejo-bin, plik-bin, remark42-bin --- packages/bin/dufs-bin/DEBBUILD | 7 ++++++- packages/bin/filebrowser-bin/DEBBUILD | 14 +++++++++++++- .../filebrowser-bin/materials/filebrowser.service | 6 +++--- packages/bin/forgejo-bin/DEBBUILD | 5 ++++- packages/bin/plik-bin/DEBBUILD | 6 +++++- packages/bin/remark42-bin/DEBBUILD | 7 ++++++- 6 files changed, 37 insertions(+), 8 deletions(-) diff --git a/packages/bin/dufs-bin/DEBBUILD b/packages/bin/dufs-bin/DEBBUILD index 1bc7d1f..fe5748d 100644 --- a/packages/bin/dufs-bin/DEBBUILD +++ b/packages/bin/dufs-bin/DEBBUILD @@ -3,7 +3,7 @@ pkgname="dufs" arch="amd64" pkgver="0.38.0" -pkgrel=1 +pkgrel=2 pkgdesc="A file server that supports static serving, uploading, searching, accessing control, webdav..." url="https://github.com/sigoden/dufs" maintainer="Leafee98 " @@ -26,8 +26,13 @@ function debian_postinst { cat << EOF #!/usr/bin/env bash adduser --system dufs + mkdir -p /srv/dufs chown dufs:dufs -R /srv/dufs + systemctl daemon-reload +if systemctl is-active --quiet dufs.service ; then + systemctl restart dufs.service +fi EOF } diff --git a/packages/bin/filebrowser-bin/DEBBUILD b/packages/bin/filebrowser-bin/DEBBUILD index 705fabd..94e5bf0 100644 --- a/packages/bin/filebrowser-bin/DEBBUILD +++ b/packages/bin/filebrowser-bin/DEBBUILD @@ -3,7 +3,7 @@ pkgname="filebrowser" arch="amd64" pkgver="2.26.0" -pkgrel=1 +pkgrel=2 pkgdesc="Web File Browser" maintainer="Leafee98 " url="https://github.com/filebrowser/filebrowser" @@ -26,3 +26,15 @@ function package { install -Dm644 ${srcdir}/filebrowser.service ${pkgdir}/usr/lib/systemd/system/filebrowser.service } +function debian_postinst { + cat << EOF +#!/usr/bin/env bash +adduser --system filebrowser + +systemctl daemon-reload + +if systemctl is-active --quiet filebrowser.service ; then + systemctl restart filebrowser.service +fi +EOF +} diff --git a/packages/bin/filebrowser-bin/materials/filebrowser.service b/packages/bin/filebrowser-bin/materials/filebrowser.service index a880b4b..cfc2231 100644 --- a/packages/bin/filebrowser-bin/materials/filebrowser.service +++ b/packages/bin/filebrowser-bin/materials/filebrowser.service @@ -3,12 +3,12 @@ Description=Filebrowser is a Web File Browser After=network.target apache2.service [Service] -# User=filebrowser -# Group=filebrowser +User=filebrowser +Group=filebrowser WorkingDirectory=/var/lib/filebrowser -ExecStart=/usr/bin/filebrowser -r /path/to/your/storage +ExecStart=/usr/bin/filebrowser -r /var/lib/filebrowser Restart=on-failure [Install] diff --git a/packages/bin/forgejo-bin/DEBBUILD b/packages/bin/forgejo-bin/DEBBUILD index 8dfb085..cfe9df0 100644 --- a/packages/bin/forgejo-bin/DEBBUILD +++ b/packages/bin/forgejo-bin/DEBBUILD @@ -2,7 +2,7 @@ pkgname="forgejo" arch="amd64" -pkgrel=1 +pkgrel=2 pkgver="1.21.2-1" pkgdesc="A painless selfhost git service." url="https://codeberg.org/forgejo/forgejo" @@ -33,5 +33,8 @@ adduser --system git chown -R git:git /var/lib/forgejo systemctl daemon-reload +if systemctl is-active --quiet forgejo.service ; then + systemctl restart forgejo.service +fi EOF } diff --git a/packages/bin/plik-bin/DEBBUILD b/packages/bin/plik-bin/DEBBUILD index dd7b7a9..d0e4971 100644 --- a/packages/bin/plik-bin/DEBBUILD +++ b/packages/bin/plik-bin/DEBBUILD @@ -2,7 +2,7 @@ pkgname="plik-bin" arch="amd64" -pkgrel=3 +pkgrel=4 pkgver="1.3.8" pkgdesc="Plik is a temporary file upload system (Wetransfer like) in Go." _arch="amd64" @@ -30,6 +30,10 @@ function debian_postinst { cat << EOF #!/usr/bin/env bash adduser --system plik + systemctl daemon-reload +if systemctl is-active --quiet plik.service ; then + systemctl restart plik.service +fi EOF } diff --git a/packages/bin/remark42-bin/DEBBUILD b/packages/bin/remark42-bin/DEBBUILD index abc64f0..d1e94a1 100644 --- a/packages/bin/remark42-bin/DEBBUILD +++ b/packages/bin/remark42-bin/DEBBUILD @@ -2,7 +2,7 @@ pkgname="remark42" pkgver=1.12.0 -pkgrel=3 +pkgrel=4 arch="amd64" pkgcommit="" section="utils" @@ -31,5 +31,10 @@ function debian_postinst { #!/usr/bin/env bash touch /etc/default/remark42 adduser --system remark42 + +systemctl daemon-reload +if systemctl is-active --quiet remark42.service ; then + systemctl restart remark42.service +fi EOF }