FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 03-10-2010, 04:26 PM
Byron Clark
 
Default openssh 5.4p1-2

On Wed, Mar 10, 2010 at 10:24:10AM -0700, Byron Clark wrote:
> On Wed, Mar 10, 2010 at 06:15:32PM +0100, Linas wrote:
> > Byron Clark wrote:
> > >On Wed, Mar 10, 2010 at 09:32:15AM -0700, Byron Clark wrote:
> > >>if pidof sshd | grep -q $(cat /var/run/sshd.pid); then
> > >> echo "pid in /var/run/sshd.pid is valid"
> > >>else
> > >> echo "invalid pid"
> > >>fi
> > >Ignore that, it isn't entirely safe.
> >
> > You may want grep -q "^$(cat /var/run/sshd.pid)$"
>
> Unfortunately that only works if there is only one sshd process returned
> by pidof. Here's the case I'm worried about:
>
> /var/run/sshd.pid: 343
> pidof sshd: 3433

And the case where add ^$ around the pid breaks:

/var/run/sshd.pid: 343
pidof sshd: 343 2452 2453

--
Byron Clark
 
Old 03-10-2010, 05:26 PM
Linas
 
Default openssh 5.4p1-2

Byron Clark wrote:

Unfortunately that only works if there is only one sshd process returned
by pidof. Here's the case I'm worried about:

/var/run/sshd.pid: 343
pidof sshd: 3433


And the case where add ^$ around the pid breaks:

/var/run/sshd.pid: 343
pidof sshd: 343 2452 2453



Yes of course. I foolishly only thought "how to avoid matching partial
numbers"

despite being aware of the general problem.
What we need are word boundaries: grep -q "$(cat /var/run/sshd.pid)"

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 
Old 03-12-2010, 04:23 PM
Pierre Schmitz
 
Default openssh 5.4p1-2

So, what should we actually do about this? It seems there is no simple
resolution to fix both bugs. My suggestion would be to revert the rc.d script
changes and see if we could come up with a better approach in the future.

--

Pierre Schmitz, https://users.archlinux.de/~pierre
 
Old 03-12-2010, 09:17 PM
Allan McRae
 
Default openssh 5.4p1-2

On 13/03/10 03:23, Pierre Schmitz wrote:

So, what should we actually do about this? It seems there is no simple
resolution to fix both bugs. My suggestion would be to revert the rc.d script
changes and see if we could come up with a better approach in the future.


Just revert it and (re)open a bug report with all the details so it does
not get lost.
 
Old 03-12-2010, 09:42 PM
Thomas Bächler
 
Default openssh 5.4p1-2

Am 12.03.2010 23:17, schrieb Allan McRae:
> On 13/03/10 03:23, Pierre Schmitz wrote:
>> So, what should we actually do about this? It seems there is no simple
>> resolution to fix both bugs. My suggestion would be to revert the rc.d
>> script
>> changes and see if we could come up with a better approach in the future.
>
> Just revert it and (re)open a bug report with all the details so it does
> not get lost.

I still don't see what's wrong about the solution I provided.
 
Old 03-12-2010, 10:18 PM
Pierre Schmitz
 
Default openssh 5.4p1-2

Am Freitag, 12. März 2010 23:42:53 schrieb Thomas Bächler:
> > Just revert it and (re)open a bug report with all the details so it does
> > not get lost.
>
> I still don't see what's wrong about the solution I provided.

I am not sure which solution you meant. (there is none in this thread)

--

Pierre Schmitz, https://users.archlinux.de/~pierre
 
Old 03-13-2010, 09:32 AM
Thomas Bächler
 
Default openssh 5.4p1-2

Am 13.03.2010 00:18, schrieb Pierre Schmitz:
> Am Freitag, 12. März 2010 23:42:53 schrieb Thomas Bächler:
>>> Just revert it and (re)open a bug report with all the details so it does
>>> not get lost.
>>
>> I still don't see what's wrong about the solution I provided.
>
> I am not sure which solution you meant. (there is none in this thread)
>

http://bugs.archlinux.org/task/17138#comment58984
 
Old 03-13-2010, 09:39 AM
Pierre Schmitz
 
Default openssh 5.4p1-2

Am Samstag, 13. März 2010 11:32:40 schrieb Thomas Bächler:
> Am 13.03.2010 00:18, schrieb Pierre Schmitz:
> > Am Freitag, 12. März 2010 23:42:53 schrieb Thomas Bächler:
> >>> Just revert it and (re)open a bug report with all the details so it
> >>> does not get lost.
> >>
> >> I still don't see what's wrong about the solution I provided.
> >
> > I am not sure which solution you meant. (there is none in this thread)
>
> http://bugs.archlinux.org/task/17138#comment58984

$(readlink /proc/$PID/exe) will return "/usr/sbin/sshd (deleted)" if you
update a running sshd. A sshd stop will fail then.

--

Pierre Schmitz, https://users.archlinux.de/~pierre
 

Thread Tools




All times are GMT. The time now is 09:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org