Package: influxdb
Version: 0.13.0+dfsg1-2
Severity: minor
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi Alexandre,

During influxdb installation, the following warning is displayed:

[…]
Warning: The home dir /var/lib/influxdb you specified can't be accessed: 
No such file or directory
[…]

The root cause is pretty obvious, adduser tries to set influxdb user
home before it ever exist. There are many ways to fix that issue, for 
example we could create the necessary directory before calling adduser 
in the post-installation script, removing the “--no-create-home” from 
adduser call, etc. In the attached patches, you’ll see that I chose 
another solution that involves using debhelper’s facilities.

Additionaly, you’ll find patches (0003* and 0004*) handling 
/var/log/influxdb creation using the same method.

Thanks for maintaining influxdb!

Cheers,
Vincent


- -- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages influxdb depends on:
ii  adduser              3.115
ii  init-system-helpers  1.36
ii  libc6                2.23-1

influxdb recommends no packages.

influxdb suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXkAOpAAoJEIqc7nZacaeAYiQQAMuwZOKZY/EvumpLIOsoi7+s
6guiSUOJ9yT3+ZHW6iIsgNO/gRz9TI2Z0n3R30ILhf/3vZfMSloNoJyzrrjNy66a
wCpt6ojtbTGDLfEc30fKP6Rp1Gm9OTryLY7f8Abg4A8pGthnsFcfsGLrVhI82GLA
6eru7lKadQjDSdr+RVtgbwqgJmDTR4IdK4ti1Cwyh5zG6NOXO7MD0LJnoNmG1++i
sFvbGkBFu5wiLR2AJSvE7Yy0ofBKn7kFP+zo6LDyNGIlNQH9xlEvzVnhzYD9ycbi
wT2AN6W8i34gdI/4v8d8sJPWpQJXdWQLNEk+K1vbhaSoC5/+SYG+lmMx4wqiitRz
/IT12zNpK3h3yN6lJB4CqPkv7paCYrg/H+CpnmE+6KpdZN+f3gohxEfrnCnnj+Dc
P8gDaoqU8AZHXpGqOBHYywnIe6OPKiYUCMFRjyFbX38eJlq7HY6A8e0PNourSr3I
nhtu3mhHYs6KwJEV7m5TdHM9ADtvb9iHIhghHWE6Mc20x+MyKTZWnOzWFtX6cggm
e4nziyyusZrHcnM5LXyWMxm7fFOMnj37vawsZe8VmPqbtXQbEFexM/9wxPswAgLD
jLX646dOjGMH4BDlxvnjRuHLSpC+kmhD3arERxwtTnrt/IPseKtOtzakCEYEsLXK
/NcueVOoAzvSHaUpE+70
=/rqP
-----END PGP SIGNATURE-----
>From b41ba68fc27275f3ed73fa395ab13e8b904cb9ba Mon Sep 17 00:00:00 2001
From: Vincent Blut <vincent.deb...@free.fr>
Date: Tue, 19 Jul 2016 20:42:04 +0200
Subject: [PATCH 1/2] d/influxdb.dirs: Add var/log/influxdb

---
 debian/influxdb.dirs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/influxdb.dirs b/debian/influxdb.dirs
index ea966c3..2bc9a2c 100644
--- a/debian/influxdb.dirs
+++ b/debian/influxdb.dirs
@@ -1 +1,2 @@
 var/lib/influxdb
+var/log/influxdb
-- 
2.8.1

>From f06022b6f772a549cad35da0ae4834f3cc15b31b Mon Sep 17 00:00:00 2001
From: Vincent Blut <vincent.deb...@free.fr>
Date: Tue, 19 Jul 2016 20:54:18 +0200
Subject: [PATCH 2/2] d/influxdb.postinst: Use debhelper facility to create
 /var/log/influxdb

---
 debian/influxdb.postinst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/influxdb.postinst b/debian/influxdb.postinst
index 94861f0..2d1f9dc 100644
--- a/debian/influxdb.postinst
+++ b/debian/influxdb.postinst
@@ -31,9 +31,9 @@ case "$1" in
         chown -R influxdb:influxdb /var/lib/influxdb
     fi
 
-    # create logdir
-    mkdir -p /var/log/influxdb
-    chown -R influxdb:influxdb /var/log/influxdb
+    if [ -d /var/log/influxdb ]; then
+        chown -R influxdb:influxdb /var/log/influxdb
+    fi
 
     # create rundir
     mkdir -p /var/run/influxdb
-- 
2.8.1

>From 45d837607172052996e67f6411b177f5e6059241 Mon Sep 17 00:00:00 2001
From: Vincent Blut <vincent.deb...@free.fr>
Date: Sun, 17 Jul 2016 16:48:57 +0200
Subject: [PATCH 1/2] d/influxdb.dirs: Create /var/lib/influxdb using debhelper
 facility

---
 debian/influxdb.dirs | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 debian/influxdb.dirs

diff --git a/debian/influxdb.dirs b/debian/influxdb.dirs
new file mode 100644
index 0000000..ea966c3
--- /dev/null
+++ b/debian/influxdb.dirs
@@ -0,0 +1 @@
+var/lib/influxdb
-- 
2.8.1

>From 221ed56a75aff6d750cff73cd89505553ffcd599 Mon Sep 17 00:00:00 2001
From: Vincent Blut <vincent.deb...@free.fr>
Date: Sun, 17 Jul 2016 17:06:53 +0200
Subject: [PATCH 2/2] d/influxdb.postinst: Let debhelper facility handle
 directory creation

---
 debian/influxdb.postinst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/influxdb.postinst b/debian/influxdb.postinst
index 2dbf8bd..94861f0 100644
--- a/debian/influxdb.postinst
+++ b/debian/influxdb.postinst
@@ -27,9 +27,9 @@ case "$1" in
         adduser influxdb influxdb
         fi
 
-    # create data directory
-    mkdir -p /var/lib/influxdb
-    chown -R influxdb:influxdb /var/lib/influxdb
+    if [ -d /var/lib/influxdb ]; then
+        chown -R influxdb:influxdb /var/lib/influxdb
+    fi
 
     # create logdir
     mkdir -p /var/log/influxdb
-- 
2.8.1

_______________________________________________
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Reply via email to