From owner-freebsd-bugs@FreeBSD.ORG Sun Jul 13 10:00:34 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C406537B401 for ; Sun, 13 Jul 2003 10:00:34 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A69143F3F for ; Sun, 13 Jul 2003 10:00:33 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6DH0XUp086582 for ; Sun, 13 Jul 2003 10:00:33 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6DH0XFw086581; Sun, 13 Jul 2003 10:00:33 -0700 (PDT) Resent-Date: Sun, 13 Jul 2003 10:00:33 -0700 (PDT) Resent-Message-Id: <200307131700.h6DH0XFw086581@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andreas Klemm Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B77D537B404 for ; Sun, 13 Jul 2003 10:00:13 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3836B43F93 for ; Sun, 13 Jul 2003 10:00:12 -0700 (PDT) (envelope-from andreas@klemm.apsfilter.org) Received: from srv1.cosmo-project.de (localhost [IPv6:::1]) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h6DH09hR055991 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 13 Jul 2003 19:00:10 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: (from uucp@localhost)h6DH09xe055990 for FreeBSD-gnats-submit@FreeBSD.org; Sun, 13 Jul 2003 19:00:09 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: from titan.klemm.apsfilter.org (localhost.klemm.apsfilter.org [127.0.0.1]) by klemm.apsfilter.org (8.12.9/8.12.9) with ESMTP id h6DGw7Tv002352 for ; Sun, 13 Jul 2003 18:58:07 +0200 (CEST) (envelope-from andreas@titan.klemm.apsfilter.org) Received: (from andreas@localhost) by titan.klemm.apsfilter.org (8.12.9/8.12.9/Submit) id h6DGw73R002351; Sun, 13 Jul 2003 18:58:07 +0200 (CEST) Message-Id: <200307131658.h6DGw73R002351@titan.klemm.apsfilter.org> Date: Sun, 13 Jul 2003 18:58:07 +0200 (CEST) From: Andreas Klemm To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/54446: pkg_delete doesn't honour symlinks, portupgrades leads to failing services (i.e. squid) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andreas Klemm List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2003 17:00:35 -0000 >Number: 54446 >Category: bin >Synopsis: pkg_delete doesn't honour symlinks, portupgrades leads to failing services (i.e. squid) >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 13 10:00:32 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Andreas Klemm >Release: FreeBSD-current >Organization: FreeBSD >Environment: System: FreeBSD titan.klemm.apsfilter.org 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Sat Jul 12 16:46:09 CEST 2003 root@titan.klemm.apsfilter.org:/usr/src/sys/i386/compile/TITAN i386 FreeBSD 5.2-current and all other FreeBSD releases Always happended to me when upgrading squid on a machine, since I always use symlinks to move the cache to a larger directory than /usr/local ... >Description: Upgrade of squid port brings squid into non operational state, if the toplevel of the data directory (/usr/local/squid) is a symlink (to /var/squid for example) and not a real directory. I assume the reason is, that pkg_delete doesn't honor symlinks. The toplevel directory of squid data and logs (/usr/local/squid) would normally not being removed by pkg_delete, if there are additional files under /usr/local/squid/{cache, logs}. This is the case, if you use squid for a while and then upgrade the port. But if its a symlink then /usr/local/sqzid will be deleted and the upgrade of the port installs the usual fresh/empty /usr/local/squid data directory ... The result is a dying squid that doesn't find its data directory. This behaviour should be changed in pkg_delete to make upgrade of ports more smoothly / reliable, if part of a large tree had to be moved away. Since this could also be a subtree somewhere under /usr/local/squid, pkg_delete should alway check, if file is a symlink and follow. >How-To-Repeat: install squid from ports mv /usr/local/squid /var/squid ln -s /var/squid /usr/local/squid squid -z Then remove and reinstall the squid port or perform: portupgrade -af All squid ports of today and in the past have the negativ side effect, that the symlink /usr/local/squid to the real data directory /var/squid simply gets removed. >Fix: no fix available at this time. I assume, that the pkg_delete is the culprit, it doesn't know about symlinks .... >Release-Note: >Audit-Trail: >Unformatted: