From owner-freebsd-questions@freebsd.org Tue Nov 7 18:11:37 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0C1AE60669 for ; Tue, 7 Nov 2017 18:11:37 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 839007CAAA for ; Tue, 7 Nov 2017 18:11:37 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: by mail-io0-x229.google.com with SMTP id m16so3112241iod.1 for ; Tue, 07 Nov 2017 10:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=k10UOYZthLbR7EeTgtv3jDA9ReB2E+u3sAwGv9Jw76E=; b=nUY7KhvrxY9E9PrN0zmrJ7stOfxyv/tIK3WrK1rLS29BL2qUxWl3mLVnAYtIav7giI yZJeN5oHdVpUQ9haBe5kuxrbD1EsEp6RzNFyulmGVD9Q1q/VKAmqtG5bq8pgph42Bs+k 7EH8enLpBKBWWYZjavbfXgu7h7+wiwgQa50ZsRgW4Bro0lkQnYosL5110gBVTkXhJvuT BluYZpQmvMPVhbCFJgYUcFTalCJLrjXk5z7Worrhsz9nUNoFiDGveEqjtwLTykXrA5wU TOoZ7FoRn49sp5KV1oe3P3+3dqll7Zu3ui/PqiTdftrFuDjb7RNV/Fs9KV1h3ZAbDif2 N76A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-transfer-encoding; bh=k10UOYZthLbR7EeTgtv3jDA9ReB2E+u3sAwGv9Jw76E=; b=Ca2f53qDbY7pH5X2Jv0DcxACgtiTbtltRsOd41ERAzoOc633nTRWfdmpr/d42g7XFS FUBPz4YI5KW2y0E4o363SuFh1zYh0qPJJL3akKpka8GKZkLhUzt7zbCQHqtqoBA6suPY bPdkkHSo/olgFxZorWEK1FAhdXUu8+JDK05c9fpulAsmLFNUq/BHUPgfrq0noqONWnP8 /uCXG+HZUayvF/PGjCjsoN377SLQjGrqJRURd7GWZuM7D6UIWGWY0CyVNe48OMauwIyl E6RSXTxrugrg+HYKe97bG44EE+PivQh+kbVfPLq1SmwcpkTJnuQHgJfGwya8HbpEfAby 922g== X-Gm-Message-State: AJaThX7Ci72TKM6odEfoTQvYhLCajS0aX8ejBq4aRoLTeU+/nMEEQ8ZA XWwWUAmu9hWMIG5NLL8ZHCbZ+Q== X-Google-Smtp-Source: ABhQp+QlQKQqmvswBEEglDR5LgedRVbMLZVwmoaDWzuAy9oDCjCzKmwHR0bvdrVpVMj8W63h+aTkyw== X-Received: by 10.107.112.12 with SMTP id l12mr27086127ioc.122.1510078296918; Tue, 07 Nov 2017 10:11:36 -0800 (PST) Received: from [10.0.10.7] (cpe-65-25-50-122.neo.res.rr.com. [65.25.50.122]) by smtp.googlemail.com with ESMTPSA id i130sm1051564itf.42.2017.11.07.10.11.36 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Nov 2017 10:11:36 -0800 (PST) Message-ID: <5A01F758.1050706@gmail.com> Date: Tue, 07 Nov 2017 13:11:36 -0500 From: Ernie Luzar User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Ian Smith CC: freebsd-questions@freebsd.org Subject: Re: Need help with rc.d script References: <20171108021900.W9710@sola.nimnet.asn.au> <20171108043726.N72828@sola.nimnet.asn.au> In-Reply-To: <20171108043726.N72828@sola.nimnet.asn.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 18:11:37 -0000 Thanks Ian, Ending the while loop with "done &" worked. When I issue dynip from the command line it runs as a daemon but I have to use the kill command to stop it. This is my rc.d script for dynip script. issuing "service dynip start" works but "service dynip stop" gives message saying dynip not running? (Check /var/run/dynip.pid). Well ps ax shows it is running and I have to use the kill command to stop it. Here is my rc.d script. What am I missing to populate the dynip.pid file so "service dynip stop" command will work? #!/bin/sh # # # PROVIDE: dynip # REQUIRE: LOGIN # KEYWORD: nojail shutdown # # Add the following line to /etc/rc.conf to enable dynip: # # dynip_enable="YES" # . /etc/rc.subr name="dynip" rcvar=dynip_enable command="/usr/local/sbin/${name}" pidfile="/var/run/${name}.pid" load_rc_config ${name} run_rc_command "$1"