telegraf package maintainer scripts broken - telegraf service not restarting after upgrade

Bug #1785570 reported by Junien F
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Telegraf Charm
Fix Released
High
Telegraf Devs

Bug Description

Hi,

(not a charm bug, but this is the best way I found to report a package bug)

On xenial, the telegraf service is not started back up after a pakage upgrade. Simulation with --reinstall below. This is impacting at least version 1.6.4+git-d5dde16~201807170838~ubuntu16.04.1.

I believe this is because prerm disables the service. We probably should only be using dh to handle service start/stop/restart/deactivation/activation.

ubuntu@ubuntu:~$ sudo systemctl status telegraf.service
● telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
   Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-08-06 08:02:00 UTC; 1min 45s ago
     Docs: https://github.com/influxdata/telegraf
 Main PID: 3275 (telegraf)
   CGroup: /system.slice/telegraf.service
           └─3275 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

Aug 06 08:02:00 ubuntu systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Starting Telegraf v1.6.0~unknown
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Loaded outputs: prometheus_client
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Loaded inputs: inputs.cpu inputs.disk inputs.diskio inputs.mem inputs.net inputs.netstat inputs.swap inputs.system
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Tags enabled: host=controller:ubuntu-0
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"controller:ubuntu-0", Flush Interval:10s

ubuntu@ubuntu:~$ sudo apt-get install --reinstall telegraf
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 4 not upgraded.
Need to get 0 B/6,737 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 135172 files and directories currently installed.)
Preparing to unpack .../telegraf_1.6.4+git-d5dde16~201807170838~ubuntu16.04.1_amd64.deb ...
Removed symlink /etc/systemd/system/telegraf.service.
Removed symlink /etc/systemd/system/multi-user.target.wants/telegraf.service.
Unpacking telegraf (1.6.4+git-d5dde16~201807170838~ubuntu16.04.1) over (1.6.4+git-d5dde16~201807170838~ubuntu16.04.1) ...
Setting up telegraf (1.6.4+git-d5dde16~201807170838~ubuntu16.04.1) ...
telegraf.service is a disabled or a static unit not running, not starting it.
telegraf.service is a disabled or a static unit, not starting it.

ubuntu@ubuntu:~$ sudo systemctl status telegraf.service
● telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
   Loaded: loaded (/lib/systemd/system/telegraf.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://github.com/influxdata/telegraf

Aug 06 07:55:46 ubuntu systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
Aug 06 08:02:00 ubuntu systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Starting Telegraf v1.6.0~unknown
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Loaded outputs: prometheus_client
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Loaded inputs: inputs.cpu inputs.disk inputs.diskio inputs.mem inputs.net inputs.netstat inputs.swap inputs.system
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Tags enabled: host=controller:ubuntu-0
Aug 06 08:02:00 ubuntu telegraf[3275]: 2018-08-06T08:02:00Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"controller:ubuntu-0", Flush Interval:10s
Aug 06 08:03:53 ubuntu systemd[1]: Stopping The plugin-driven server agent for reporting metrics into InfluxDB...
Aug 06 08:03:53 ubuntu systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
Aug 06 08:03:53 ubuntu systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.

Junien F (axino)
Changed in telegraf-charm:
importance: Undecided → High
assignee: nobody → Telegraf Devs (telegraf-devs)
Junien F (axino)
summary: - telegraf package maintainer scripts broken
+ telegraf package maintainer scripts broken - telegraf service not
+ restarting after upgrade
Revision history for this message
Laurent Sesquès (sajoupa) wrote :
Changed in telegraf-charm:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.