Skip to content

Instantly share code, notes, and snippets.

@joeydumont
Created September 27, 2017 15:49
Show Gist options
  • Save joeydumont/b500f7a822cf166c1ea91af0db102c57 to your computer and use it in GitHub Desktop.
Save joeydumont/b500f7a822cf166c1ea91af0db102c57 to your computer and use it in GitHub Desktop.
Duplicati.Server.exe as duplicati user
diff --git a/PKGBUILD b/PKGBUILD
index 7af25ea..f82574a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=duplicati-latest
pkgver=2.0.2.8
-pkgrel=1
+pkgrel=2
_date=2017-09-20
_branch=canary
pkgdesc='A free backup client that securely stores encrypted, incremental, compressed backups on cloud storage services and remote file servers'
@@ -13,7 +13,8 @@ license=('LGPL')
install=duplicati.install
source=(https://github.com/duplicati/duplicati/releases/download/v${pkgver}-${pkgver}_${_branch}_${_date}/duplicati-${pkgver}_${_branch}_${_date}.zip
duplicati-user.service
- duplicati.service)
+ duplicati.service
+ duplicati.sysusers)
sha256sums=('1740c8327e8d67a82a0d5b66ff2e6912fa95bf420790e105b20d6afc4028ae8c'
'ec25b25d0e331ddfb90940555068aa941c3d5dfaf858cffb6c75e810175c9d27'
'bca921cfddd95c951aceb796572eb51ce6df437c6f05660333c47be726573438')
@@ -24,6 +25,7 @@ package() {
# Install the service.
install -Dm644 duplicati.service "${pkgdir}/usr/lib/systemd/system/duplicati.service"
install -Dm644 duplicati-user.service "${pkgdir}/usr/lib/systemd/user/duplicati.service"
+ install -Dm644 "$srcdir/duplicati.sysusers" "$pkgdir/usr/lib/sysusers.d/duplicati.conf
rm duplicati.service duplicati-user.service
# Install the program.
diff --git a/duplicati.install b/duplicati.install
index afd9cce..6a76bbb 100644
--- a/duplicati.install
+++ b/duplicati.install
@@ -3,7 +3,25 @@ post_install() {
}
post_upgrade() {
+ systemd-sysusers duplicati.conf
+ mkdir -p /var/lib/duplicati
+ chown -R duplicati:duplicati /var/lib/duplicati
+if [ $(vercmp $2 2.0.2.8-2) -lt 0 ]; then
+cat << EOF
+ * In versions prior to 2.0.2.8-2, the system version of duplicati.service
+ * started Duplicati.Server.exe as root. It now runs as user duplicati.
+ * Please move your old duplicati database from
+ * /root/.config/Duplicati
+ * to
+ * /var/lib/duplicati/.config/Duplicati
+ * To run Duplicati.Server.exe as root, simply use systemd's "drop-in" feature
+ * and specify
+ * User=root
+ * Group=root
+EOF
+fi
+
cat << EOF
* UI can be accessed via following URL: http://localhost:8200
* Running duplicati user instance (using current user account)
@carbolymer
Copy link

  • line 29: duplicati.sysusers is missing

I think also file duplicati.sysusers is missing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment