From owner-freebsd-questions Mon Jan 14 9:32:53 2002 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-201-166.mmcable.com [65.31.201.166]) by hub.freebsd.org (Postfix) with SMTP id 9D5B137B416 for ; Mon, 14 Jan 2002 09:32:47 -0800 (PST) Received: (qmail 3298 invoked by uid 100); 14 Jan 2002 17:32:40 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15427.5687.862569.111625@guru.mired.org> Date: Mon, 14 Jan 2002 11:32:39 -0600 To: Christopher Schulte Cc: "Mike Meyer" , Brian T.Schellenberger , questions@freebsd.org Subject: Re: Restarting a service In-Reply-To: <5.1.0.14.0.20020114101809.04018490@pop3s.schulte.org> References: <71952277@toto.iv> <5.1.0.14.0.20020114101809.04018490@pop3s.schulte.org> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.44 (Python 2.2; freebsd-4.4-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Christopher Schulte types: > At 09:55 AM 1/14/2002 -0600, Mike Meyer wrote: > > > killall -HUP sshd > > > should do it. > > > > > > (killall is basically ps -aux | grep | kill all wrapped up into a neat > > > automated package for you) > > > >I thought about pointing that out, but for sshd it's a bad > >idea. Unless you want to log off everyone logged in via ssh at the > >same time, that is. > > Use lsof ( /usr/ports/sysutils/lsof ) and HUP only the listening sshd process. > > # lsof -i tcp:22 | grep LISTEN > sshd 89005 root 4u IPv4 0xcd88ab60 0t0 TCP *:ssh (LISTEN) > > # killall -HUP 89005 If you're only going to name one process, why bother with killall. Just use kill. At which point you're looking at the difference between an lsof and a grep to find the process, and a ps and grep with some visual inspection to find it. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message