Bug#813544: [pkg-go] Bug#813544: prometheus-node-exporter: cannot run as root

2016-02-03 Thread Martín Ferrari
Hi Anton,

On 02/02/16 23:10, Anton T wrote:

> It seems that setting USER=root in /etc/default/prometheus-node-exporter
> breaks the init script because HELPER_ARGS is defined before
> /etc/default/$NAME is included.

Thanks for the patch! I have already applied it in the git repository,
and will be uploaded soon.

Now, I would not recommend to run the node exporter as root, unless
absolutely necessary. Do you have a use case for it?

-- 
Martín Ferrari (Tincho)



Bug#813544: [pkg-go] Bug#813544: prometheus-node-exporter: cannot run as root

2016-02-03 Thread Martín Ferrari
On 03/02/16 19:20, Anton wrote:

>> Now, I would not recommend to run the node exporter as root,
>> unless absolutely necessary. Do you have a use case for it?
> 
> I have a number of filesystems that are mounted within a directory
> structure only accessible by root. Non-root users are unable to
> statfs() those mount points, however I need to monitor their disk
> usage. What I will probably do in the long-term is mount those
> partitions into another directory and then bind-mount them to the
> root-owned path, however running the exporter as root is a
> work-around I am using until that happens.

Ah, I see. You could manually create the stats with a cronjob and use
the textfile collector, but that would be pretty hackish too..


-- 
Martín Ferrari (Tincho)



Bug#813544: [pkg-go] Bug#813544: prometheus-node-exporter: cannot run as root

2016-02-03 Thread Anton
Hi Martín,

> Thanks for the patch! I have already applied it in the git repository,
> and will be uploaded soon.

Thanks for the quick fix!

> 
> Now, I would not recommend to run the node exporter as root, unless
> absolutely necessary. Do you have a use case for it?

I have a number of filesystems that are mounted within a directory structure 
only accessible by root.
Non-root users are unable to statfs() those mount points, however I need to 
monitor their disk usage.
What I will probably do in the long-term is mount those partitions into another 
directory and then bind-mount them to the root-owned path, however running the 
exporter as root is a work-around I am using until that happens.

- Anton


Bug#813544: prometheus-node-exporter: cannot run as root

2016-02-02 Thread Anton T
Package: prometheus-node-exporter
Version: 0.12.0+ds-2
Severity: important
Tags: patch

Dear Maintainer,

It seems that setting USER=root in /etc/default/prometheus-node-exporter
breaks the init script because HELPER_ARGS is defined before
/etc/default/$NAME is included.

This patch fixes the issue:
--- /etc/init.d/prometheus-node-exporter.orig   2016-02-02 23:06:36.0 
+
+++ /etc/init.d/prometheus-node-exporter2016-02-02 23:07:06.0 
+
@@ -23,12 +23,12 @@
 PIDFILE=/var/run/prometheus/prometheus-node-exporter.pid
 LOGFILE=/var/log/prometheus/prometheus-node-exporter.log

-HELPER=/usr/bin/daemon
-HELPER_ARGS="--name=$NAME --output=$LOGFILE --pidfile=$PIDFILE --user=$USER"
-
 ARGS=""
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME

+HELPER=/usr/bin/daemon
+HELPER_ARGS="--name=$NAME --output=$LOGFILE --pidfile=$PIDFILE --user=$USER"
+
 do_start_prepare()
 {
 mkdir -p `dirname $PIDFILE` || true


Kind regards,
Anton

-- System Information:
Debian Release: 8.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

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

Versions of packages prometheus-node-exporter depends on:
ii  daemon  0.6.4-1
ii  libc6   2.19-18+deb8u1

prometheus-node-exporter recommends no packages.

prometheus-node-exporter suggests no packages.

-- debconf-show failed