Bug 1331814

Summary: privoxy postuninstall scriptlet fails on a non-existing operation
Product: [Fedora] Fedora EPEL Reporter: Michal Jaegermann <michal.jnn>
Component: privoxyAssignee: Gwyn Ciesla <gwync>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: cheese, gwync
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: privoxy-3.0.24-2.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-09 23:18:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Jaegermann 2016-04-29 15:40:57 UTC
Description of problem:

The following is among package scripts and is executed on an update:

postuninstall scriptlet (using /bin/sh):
# Restart service if already running on upgrade
if [ "$1" -gt "1" ]; then
        /sbin/service privoxy condrestart > /dev/null 2>&1 ||:
fi

The trouble is that the only operations provided by the current version of this script are: start, stop and restart so this ends with

Usage: /etc/init.d/privoxy {start|stop|restart}

messages redirected to /dev/null.

In any case restarting privoxy requires some delay between stop and start.

Version-Release number of selected component (if applicable):
privoxy-3.0.24-1.el6

Comment 1 Fedora Update System 2016-06-21 14:48:41 UTC
privoxy-3.0.24-2.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-d40efedf8d

Comment 2 Fedora Update System 2016-06-22 01:47:56 UTC
privoxy-3.0.24-2.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-d40efedf8d

Comment 3 Fedora Update System 2016-07-09 23:18:19 UTC
privoxy-3.0.24-2.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 4 Michal Jaegermann 2016-07-10 16:53:56 UTC
(In reply to Fedora Update System from comment #3)
> privoxy-3.0.24-2.el6 has been pushed to the Fedora EPEL 6 stable repository.
> If problems still persist, please make note of it in this bug report.

Hm, this update does now this which is not really correct:

# Restart service if already running on upgrade
if [ "$1" -gt "1" ]; then
        /sbin/service privoxy restart > /dev/null 2>&1 ||:
fi

'restart' will start privoxy even if it was not running.  A check with pgrep for a process existence, of something similar, is missing.  Or at least something like:

# Restart service if already running on upgrade
if [ "$1" -gt "1" ]; then
        [ -e /var/run/privoxy.pid ] && \
        /sbin/service privoxy restart > /dev/null 2>&1 ||:
fi