Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenSSH: Dev

miss handling of the SIGHUP signal for sshd when sshd is started with a relative path sshd_config file

 

 

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded


sway2004009 at hotmail

Feb 25, 2009, 12:04 AM

Post #1 of 5 (1308 views)
Permalink
miss handling of the SIGHUP signal for sshd when sshd is started with a relative path sshd_config file

Hi



I am just porting ssh-5.2 to my HPUX system.



but while I'm doing it, I accidently found a different handling of the sshd for the SIGHUP signal when it is started with a "./sshd_config" and "/sshd_config".



The problem is as following:



root [at] sshpa# uname -a
HP-UX sshpa6 B.11.31 U 9000/800 2404418693 unlimited-user license

root [at] sshpa# /opt/ssh/sbin/sshd -f ./sshd_config ### ./sshd_config is a relative path
root [at] sshpa# ps -ef|grep sshd
root 12616 1 0 15:51:00 ? 0:00 /opt/ssh/sbin/sshd -f ./sshd_config
root 12618 17401 0 15:51:03 pts/tb 0:00 grep sshd
root [at] sshpa# kill -HUP 12616
root [at] sshpa# ps -ef|grep sshd
root 12620 17401 0 15:51:12 pts/tb 0:00 grep sshd ### sshd is killed but not restarted as it should be.




So is it a bug or a normal situation?





-Best Regards

-Sway



Thanks.



_________________________________________________________________
怎样买车票更方便?微软春节搜索,第一时间为您提供火车票信息!
http://piao.live.com/?form=PANER01
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


peter at stuge

Feb 25, 2009, 8:36 AM

Post #2 of 5 (1233 views)
Permalink
Re: miss handling of the SIGHUP signal for sshd when sshd is started with a relative path sshd_config file [In reply to]

Hello,

鏂藉▉ wrote:
> root [at] sshpa# /opt/ssh/sbin/sshd -f ./sshd_config ### ./sshd_config is a relative path
> root [at] sshpa# ps -ef|grep sshd
> root 12616 1 0 15:51:00 ? 0:00 /opt/ssh/sbin/sshd -f ./sshd_config
> root 12618 17401 0 15:51:03 pts/tb 0:00 grep sshd
> root [at] sshpa# kill -HUP 12616
> root [at] sshpa# ps -ef|grep sshd
> root 12620 17401 0 15:51:12 pts/tb 0:00 grep sshd ### sshd is killed but not restarted as it should be.
>
>
> So is it a bug or a normal situation?

Good question. Can you check your log files to try to find more
information about why sshd is not started again?


//Peter
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


mouring at eviladmin

Feb 25, 2009, 1:03 PM

Post #3 of 5 (1228 views)
Permalink
Re: miss handling of the SIGHUP signal for sshd when sshd is started with a relative path sshd_config file [In reply to]

On Feb 25, 2009, at 2:04 AM, 施威 wrote:

>
> Hi
>
> I am just porting ssh-5.2 to my HPUX system.
>
>
> but while I'm doing it, I accidently found a different handling of
> the sshd for the SIGHUP signal when it is started with a "./
> sshd_config" and "/sshd_config".
>
> The problem is as following:
>
> root [at] sshpa# uname -a
> HP-UX sshpa6 B.11.31 U 9000/800 2404418693 unlimited-user license
>
> root [at] sshpa# /opt/ssh/sbin/sshd -f ./sshd_config
> ### ./sshd_config is a relative path
> root [at] sshpa# ps -ef|grep sshd
> root 12616 1 0 15:51:00 ? 0:00 /opt/ssh/sbin/sshd -
> f ./sshd_config
> root 12618 17401 0 15:51:03 pts/tb 0:00 grep sshd
> root [at] sshpa# kill -HUP 12616
> root [at] sshpa# ps -ef|grep sshd
> root 12620 17401 0 15:51:12 pts/tb 0:00 grep sshd ###
> sshd is killed but not restarted as it should be.
>
> So is it a bug or a normal situation?
>

If I had the venture a guess it is because ./xxx is a relative, and
after a chdir("/") it is no longer the same location when OpenSSH is -
HUP it no longer knows where the configuration file is and thus
terminates itself.

So yes, I would expect this behavior myself.

So the simply truth is you should always do: /path/to/sshd -f /path/
to/sshd_config

- Ben
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


sway2004009 at hotmail

Feb 25, 2009, 6:19 PM

Post #4 of 5 (1253 views)
Permalink
RE: miss handling of the SIGHUP signal for sshd when sshd is started with a relative path sshd_config file [In reply to]

Hi Ben,



You are right.



But i think it would be better if sshd can get the absolute path of the configure file before it exec.



Also, i checked the syslog, it showed no sign of abnormal information about it.



So i hope sshd can either change the behavior or give out some log information.





-Best Regards

-Sway





> CC: openssh-unix-dev [at] mindrot
> From: mouring [at] eviladmin
> To: sway2004009 [at] hotmail
> Subject: Re: miss handling of the SIGHUP signal for sshd when sshd is started with a relative path sshd_config file
> Date: Wed, 25 Feb 2009 15:03:16 -0600
>
>
> On Feb 25, 2009, at 2:04 AM, 施威 wrote:
>
> >
> > Hi
> >
> > I am just porting ssh-5.2 to my HPUX system.
> >
> >
> > but while I'm doing it, I accidently found a different handling of
> > the sshd for the SIGHUP signal when it is started with a "./
> > sshd_config" and "/sshd_config".
> >
> > The problem is as following:
> >
> > root [at] sshpa# uname -a
> > HP-UX sshpa6 B.11.31 U 9000/800 2404418693 unlimited-user license
> >
> > root [at] sshpa# /opt/ssh/sbin/sshd -f ./sshd_config
> > ### ./sshd_config is a relative path
> > root [at] sshpa# ps -ef|grep sshd
> > root 12616 1 0 15:51:00 ? 0:00 /opt/ssh/sbin/sshd -
> > f ./sshd_config
> > root 12618 17401 0 15:51:03 pts/tb 0:00 grep sshd
> > root [at] sshpa# kill -HUP 12616
> > root [at] sshpa# ps -ef|grep sshd
> > root 12620 17401 0 15:51:12 pts/tb 0:00 grep sshd ###
> > sshd is killed but not restarted as it should be.
> >
> > So is it a bug or a normal situation?
> >
>
> If I had the venture a guess it is because ./xxx is a relative, and
> after a chdir("/") it is no longer the same location when OpenSSH is -
> HUP it no longer knows where the configuration file is and thus
> terminates itself.
>
> So yes, I would expect this behavior myself.
>
> So the simply truth is you should always do: /path/to/sshd -f /path/
> to/sshd_config
>
> - Ben

_________________________________________________________________
讲述中国特色文化,体验不同的节日习俗,快来微软春节搜索!
http://chunjie.live.com/?form=PANER01
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


djm at mindrot

Feb 25, 2009, 7:46 PM

Post #5 of 5 (1226 views)
Permalink
Re: miss handling of the SIGHUP signal for sshd when sshd is started with a relative path sshd_config file [In reply to]

On Wed, 25 Feb 2009, Ben Lindstrom wrote:

>
> On Feb 25, 2009, at 2:04 AM, ?? wrote:
>
> >
> > Hi
> >
> > I am just porting ssh-5.2 to my HPUX system.
> >
> >
> > but while I'm doing it, I accidently found a different handling of
> > the sshd for the SIGHUP signal when it is started with a "./
> > sshd_config" and "/sshd_config".
> >
> > The problem is as following:
> >
> > root [at] sshpa# uname -a
> > HP-UX sshpa6 B.11.31 U 9000/800 2404418693 unlimited-user license
> >
> > root [at] sshpa# /opt/ssh/sbin/sshd -f ./sshd_config
> > ### ./sshd_config is a relative path
> > root [at] sshpa# ps -ef|grep sshd
> > root 12616 1 0 15:51:00 ? 0:00 /opt/ssh/sbin/sshd -
> > f ./sshd_config
> > root 12618 17401 0 15:51:03 pts/tb 0:00 grep sshd
> > root [at] sshpa# kill -HUP 12616
> > root [at] sshpa# ps -ef|grep sshd
> > root 12620 17401 0 15:51:12 pts/tb 0:00 grep sshd ###
> > sshd is killed but not restarted as it should be.
> >
> > So is it a bug or a normal situation?
> >
>
> If I had the venture a guess it is because ./xxx is a relative, and
> after a chdir("/") it is no longer the same location when OpenSSH is -
> HUP it no longer knows where the configuration file is and thus
> terminates itself.
>
> So yes, I would expect this behavior myself.
>
> So the simply truth is you should always do: /path/to/sshd -f /path/
> to/sshd_config

We use relative config paths for the regress tests IIRC, but perhaps we
could realpath() them first.

-d
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.