Bug 216675 - sysutils/heartbeat: stops the heartbeat service on pkg upgrade
Summary: sysutils/heartbeat: stops the heartbeat service on pkg upgrade
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Gmelin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-31 14:07 UTC by Xavier Garcia
Modified: 2017-09-04 11:50 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (ports)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Garcia 2017-01-31 14:07:47 UTC
The above mentioned port stops the service when the package is being upgraded.

Stopping such a sensitive service should be left to sysadmins because they know the particularities of their setup. For instance, stopping the service may disable a VIP address, leading to an outage or trigger an unwanted failover.


The following script is executed on install/deinstall ( according to pkg info -R)

ports/head/sysutils/heartbeat/files/pkg-install.in

Please, notice that doing a pkg upgrade, we are actually doing a deinstall followed by an install.

----


!/bin/sh

PREFIX=${PREFIX:-/usr/local}

case $2 in

DEINSTALL)

        echo -e "\n\n"

        # Check for running processes
        echo -n "Checking if heartbeat is running... "
        if ps -axc | grep -q heartbeat; then
                echo -n "FOUND. Stopping... "
                ${PREFIX}/etc/rc.d/heartbeat forcestop
                echo "STOPPED"
        else
                echo "NO"
        fi
esac
EOD;
Comment 1 ports 2017-07-07 01:49:00 UTC
I understand where this is coming from but wouldn't you actually upgrade the software (by restarting it) when there is an upgrade? Seems like the system/service would be in a maintenance window during this sort of operation. It also doesn't really seem great to install the upgraded binary/scripts and then leave things untested for some later time.

I'm not opposed if others want it switched.
Comment 2 Michael Gmelin freebsd_committer freebsd_triage 2017-07-10 14:12:10 UTC
(In reply to ports from comment #1)

The problem is, that in many cases a restart of the daemon is not necessary (minor changes to perl scripts, rebuild because of a dependency). And even if the daemon changed, doing "pkg upgrade" to upgrade everything (which is kind of common these days) shouldn't stop all daemons that have been touched. Doing this in a controlled way is favorable, e.g. "Do all package updates, schedule daemon restart for low traffic time in the middle of the night". Forcing a down makes every update feel like Russian roulette, as it's hard to anticipate, which daemons will restart and which won't.
Comment 3 ports 2017-08-18 04:04:25 UTC
Sounds good. All the pkg-install.in file does is perform this unwanted function so we can remove the file out of the port.

Also, I do not actively use this software anymore so if there is someone out there that would like to take over as a maintainer I approve.
Comment 4 Michael Gmelin freebsd_committer freebsd_triage 2017-09-04 11:47:18 UTC
(In reply to ports from comment #3)
I did the change and took maintainership, thank you!
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-09-04 11:47:54 UTC
A commit references this bug:

Author: grembo
Date: Mon Sep  4 11:46:52 UTC 2017
New revision: 449242
URL: https://svnweb.freebsd.org/changeset/ports/449242

Log:
  - Remove pkg-install.in which stopped heartbeat on
    update (even if the changes didn't require it to
    do so, so it did more harm than good).
  - Take maintainership

  PR:		216675
  Approved by:	maintainer

Changes:
  head/sysutils/heartbeat/Makefile
  head/sysutils/heartbeat/files/pkg-install.in