Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2002 11:32:39 -0600
From:      "Mike Meyer" <mwm-dated-1011461560.3014d7@mired.org>
To:        Christopher Schulte <schulte+freebsd@nospam.schulte.org>
Cc:        "Mike Meyer" <mwm-dated-1011455737.3e0c77@mired.org>, Brian T.Schellenberger <bts@babbleon.org>, questions@freebsd.org
Subject:   Re: Restarting a service
Message-ID:  <15427.5687.862569.111625@guru.mired.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
Christopher Schulte <schulte+freebsd@nospam.schulte.org> 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.

	<mike
--
Mike Meyer <mwm@mired.org>			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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15427.5687.862569.111625>