From owner-freebsd-i386@FreeBSD.ORG Thu Jun 22 21:10:18 2006 Return-Path: X-Original-To: freebsd-i386@hub.freebsd.org Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30AB916A4A0 for ; Thu, 22 Jun 2006 21:10:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA12643D6E for ; Thu, 22 Jun 2006 21:10:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k5MLAGZQ095387 for ; Thu, 22 Jun 2006 21:10:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k5MLAGvn095383; Thu, 22 Jun 2006 21:10:16 GMT (envelope-from gnats) Resent-Date: Thu, 22 Jun 2006 21:10:16 GMT Resent-Message-Id: <200606222110.k5MLAGvn095383@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Vasiliy P. Melnik" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00A3D16A47C for ; Thu, 22 Jun 2006 21:04:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id B72FA43D48 for ; Thu, 22 Jun 2006 21:04:35 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k5ML4Z84057632 for ; Thu, 22 Jun 2006 21:04:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k5ML4Zf0057631; Thu, 22 Jun 2006 21:04:35 GMT (envelope-from nobody) Message-Id: <200606222104.k5ML4Zf0057631@www.freebsd.org> Date: Thu, 22 Jun 2006 21:04:35 GMT From: "Vasiliy P. Melnik" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: i386/99322: rc.d script netams truble (net-mgmt/netams) X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jun 2006 21:10:18 -0000 >Number: 99322 >Category: i386 >Synopsis: rc.d script netams truble (net-mgmt/netams) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 22 21:10:16 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Vasiliy P. Melnik >Release: 6.1 >Organization: GU ISP >Environment: FreeBSD nychka.gu.net 6.1-RELEASE-p1 FreeBSD 6.1-RELEASE-p1 #0: Tue Jun 6 14:09:48 EEST 2006 root@nychka.gu.net:/usr/obj/usr/src/sys/NYCHKA i386 >Description: if starting netams from rc.d script some times, run-daemon scrip does not check if daemoin is started and it start daemon again [12:04] ffu:~ ]#/usr/local/etc/rc.d/netams start Starting netams. [12:04] ffu:~ ]#/usr/local/etc/rc.d/netams start Starting netams. [12:04] ffu:~ ]#/usr/local/etc/rc.d/netams start Starting netams. [12:04] ffu:~ ]#lsof -i | grep netams netams 21222 root 4u IPv4 0xc17e11d0 0t0 TCP localhost:20001 (LISTEN) netams 21222 root 4u IPv4 0xc17e11d0 0t0 TCP localhost:20001 (LISTEN) netams 21222 root 4u IPv4 0xc17e11d0 0t0 TCP localhost:20001 (LISTEN) netams 21222 root 4u IPv4 0xc17e11d0 0t0 TCP localhost:20001 (LISTEN) netams 21222 root 4u IPv4 0xc17e11d0 0t0 TCP localhost:20001 (LISTEN) netams 21231 root 4u IPv4 0xc1db3ae0 0t0 TCP *:* (CLOSED) netams 21231 root 4u IPv4 0xc1db3ae0 0t0 TCP *:* (CLOSED) netams 21231 root 4u IPv4 0xc1db3ae0 0t0 TCP *:* (CLOSED) netams 21231 root 4u IPv4 0xc1db3ae0 0t0 TCP *:* (CLOSED) netams 21240 root 4u IPv4 0xc17a1570 0t0 TCP *:* (CLOSED) netams 21240 root 4u IPv4 0xc17a1570 0t0 TCP *:* (CLOSED) netams 21240 root 4u IPv4 0xc17a1570 0t0 TCP *:* (CLOSED) netams 21240 root 4u IPv4 0xc17a1570 0t0 TCP *:* (CLOSED) >How-To-Repeat: if starting netams from rc.d script some times >Fix: [0:00] nychka:/usr/ports ]#cat /usr/local/etc/rc.d/netams #!/bin/sh # $FreeBSD: ports/net-mgmt/netams/files/netams.sh.in,v 1.1 2006/06/14 12:08:24 pav Exp $ foxed rc.d script [0:01] nychka:/usr/ports ]#cat /usr/local/etc/rc.d/netams --------------------------------------------------------------------- # PROVIDE: netams # REQUIRE: NETWORKING # KEYWORD: shutdown # Add the following line to /etc/rc.conf to enable netams # # netams_enable (bool): Set to "NO" by default. # Set it to "YES" to enable netams. # netams_config (str): Custom configuration file to be passed # to netams. # # DO NOT CHANGE THESE DEFAULT VALUES HERE # . /etc/rc.subr name="netams" rcvar=`set_rcvar` load_rc_config $name :${netams_enable="NO"} :${netams_config="/usr/local/etc/netams.cfg"} pidfile="/var/run/netams.pid" command="/usr/local/libexec/netams" command_args="-lf ${netams_config} > /dev/null &" run_rc_command "$1" ---------------------------------------------------------------- [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams start netams already running? (pid=5530). [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams start netams already running? (pid=5530). [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams start netams already running? (pid=5530). [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams start netams already running? (pid=5530). [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams stop Stopping netams. Waiting for PIDS: 5530. [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams stop netams not running? (check /var/run/netams.pid). [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams start Starting netams. [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams start netams already running? (pid=70294). [0:03] nychka:~ ]#/usr/local/etc/rc.d/netams restart Stopping netams. Waiting for PIDS: 70294. Starting netams. >Release-Note: >Audit-Trail: >Unformatted: