From owner-freebsd-ports@FreeBSD.ORG Fri Sep 16 20:34:59 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14CAB106566C; Fri, 16 Sep 2011 20:34:59 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 932C68FC16; Fri, 16 Sep 2011 20:34:58 +0000 (UTC) Received: by gxk28 with SMTP id 28so4464524gxk.13 for ; Fri, 16 Sep 2011 13:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=D2FkY7N0inXvJk4QibsOWluhIsxQRMU6wjJUa/O8N6M=; b=chWxHilTltFBWbcwp0fyxKWenAn76REJBi4VpoF6qqFi6xFjj82+9mdwyij7w++OS9 eqG4ZdL/DPxqLqazhcg64eO9l8pHy2qTWAeOsJazRY8OkwYMmKhPuq0lse1XSM3nUCGV tOO9sDZbB3s2uroKGwNBowXKmdxB94XMuzlE8= MIME-Version: 1.0 Received: by 10.42.29.68 with SMTP id q4mr3445391icc.99.1316205297769; Fri, 16 Sep 2011 13:34:57 -0700 (PDT) Received: by 10.231.35.194 with HTTP; Fri, 16 Sep 2011 13:34:57 -0700 (PDT) Received: by 10.231.35.194 with HTTP; Fri, 16 Sep 2011 13:34:57 -0700 (PDT) In-Reply-To: <4E73AADB.8060804@FreeBSD.org> References: <20110912230943.GD33455@guilt.hydra> <4E6E99BC.4050909@missouri.edu> <1315905051.1747.208.camel@xenon> <4E6F8A50.9060205@gmx.de> <1315942042.1747.258.camel@xenon> <4E6FD71D.9010207@gmx.de> <20110914181553.f6d31b0f.cjr@cruwe.de> <4E722F3F.3030606@wasikowski.net> <20110915180815.GA46983@guilt.hydra> <4E7247F2.7080207@wasikowski.net> <20110915183710.GA47127@guilt.hydra> <4E7253AF.7030602@wasikowski.net> <4E725782.3090107@gmx.de> <46157122.20110916135126@serebryakov.spb.ru> <4E73709D.5020004@gmx.de> <4E73AADB.8060804@FreeBSD.org> Date: Fri, 16 Sep 2011 21:34:57 +0100 Message-ID: From: Chris Rees To: Gabor Kovesdan Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Matthias Andree , lev@freebsd.org, ports-list freebsd Subject: Re: Re-starting daemons across upgrades? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2011 20:34:59 -0000 On 16 Sep 2011 21:16, "Gabor Kovesdan" wrote: > > On 2011.09.16. 17:51, Matthias Andree wrote: >> >> Am 16.09.2011 11:51, schrieb Lev Serebryakov: >>> >>> Hello, Freebsd-ports. >>> You wrote 16 =D1=81=D0=B5=D0=BD=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2011 =D0= =B3., 0:28:07: >>> >>>>> Really? I thought it was supposed to be standard behaviour- the @stopdaemon >>>>> line in pkg-plist facilitates that. >>>> >>>> While I totally understand why we do this, I have to say it's VERY >>>> VERY annoying behavior especially when one upgrading a remote system >>>> with multiple server daemon ports. One have to watch the whole >>>> process carefully and restart the daemon manually. >>> >>> Yep, and even more annoyingly is that it is completely inconsistent: >>> some daemons are stopped, some not, etc. >> >> We do not currently have a standard procedure for that, nor do we record >> the necessary state -- perhaps we should just discuss, vote, and add a >> paragraph to the porter's handbook. >> >> We also need to bring the authors (or volunteers) for the de-facto >> standard upgrade tools into the loop. >> >> My thoughts: >> >> - give the user a choice to configure whether to restart services >> >> - optional: give the users a chance to configure this per-service >> >> - discuss whether we want/need to support this (a) in the framework that >> we currently use, (b) only in pkgng, (c) in portmaster and portupgrade >> where necessary. > > Or we could have a facility to check whether services are running. For example, I have some cron scripts, which are similar for all of the service= s that I'm watching. They run periodically and restart services if they are down. It does not matter if they are down because of an upgrade or a failure, so this solution is more general. Here's an example that I have fo= r MySQL: > > #!/bin/sh > PID_FILE=3D"/var/db/mysql/server.mypc.hu.pid" > PID=3D`cat $PID_FILE` > EXECUTABLE=3D"/usr/local/etc/rc.d/mysql-server start" > > if test -r $PID_FILE ; then > # pidfile exist, is it correct? > if kill -CHLD $PID >/dev/null 2>&1; then > # ok, exit silently > exit 0 > fi > rm -f $PID_FILE > fi > echo "" > echo "Couldn't find the MySQL server running, retsarting.." > echo "" > $EXECUTABLE > I would prefer to parse the output of rc status, but I presume this script is more specialised. Chris