Bug 1628 - /var/run/sshd.pid file collisions...
Summary: /var/run/sshd.pid file collisions...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 5.2p1
Hardware: Other Solaris
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_4
  Show dependency treegraph
 
Reported: 2009-08-05 14:25 AEST by mikee
Modified: 2010-03-26 10:51 AEDT (History)
2 users (show)

See Also:


Attachments
Use PidFile if set in sshd_config (436 bytes, text/plain)
2009-11-20 16:38 AEDT, Tim Rice
no flags Details
take 2 (447 bytes, text/plain)
2009-11-21 12:03 AEDT, Tim Rice
no flags Details
take 3 (448 bytes, text/plain)
2009-11-21 12:09 AEDT, Tim Rice
dtucker: ok+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mikee 2009-08-05 14:25:12 AEST
If I install sshd (using the SMF manifest) option and want to run it on a different port (say for some chroot/sftp action) I end up generating pid-file collisions between the existing SMF_managed Solaris-SSHd.

making the following change in: /lib/svc/method/site/opensshd
PIDFILE=$piddir/opensshd.pid

does NOT appear to solve the problem. (that PIDFILE variable seems to be entirely ignored)

--

doing the following in the config-file DOES solve the pid-issue...

/opt/OpenSSH//etc/sshd_config

    PidFile /var/run/opensshd.pid
Comment 1 Damien Miller 2009-11-20 11:34:57 AEDT
Tim, you know more about SMF that I do - could you please take a look at this?
Comment 2 Tim Rice 2009-11-20 16:38:51 AEDT
Created attachment 1726 [details]
Use PidFile if set in sshd_config

This is not really a SMF issue. The problem is our start/stop script
does not know if PidFile is set in sshd_config.

The attached patch would be one way to address this issue.
Comment 3 Damien Miller 2009-11-20 16:57:52 AEDT
Comment on attachment 1726 [details]
Use PidFile if set in sshd_config

>--- openssh/opensshd.init.in.old	2006-01-31 08:00:37.000000000 -0800
>+++ openssh/opensshd.init.in	2009-11-19 21:27:44.657360000 -0800
>@@ -14,6 +14,8 @@
> 
> SSHD=$prefix/sbin/sshd
> PIDFILE=$piddir/sshd.pid
>+PidFile=`grep "^PidFile " ${sysconfdir}/sshd_config | awk '{print $2}'`

I don't think this will cope '=' as a config separator, which is legal sshd_config syntax:

PidFile=/somewhere/sshd.pid
Comment 4 Tim Rice 2009-11-21 12:03:21 AEDT
Created attachment 1730 [details]
take 2

(In reply to comment #3)
> (From update of attachment 1726 [details])

> >+PidFile=`grep "^PidFile " ${sysconfdir}/sshd_config | awk '{print $2}'`
> 
> I don't think this will cope '=' as a config separator, which is legal
> sshd_config syntax:
> 
> PidFile=/somewhere/sshd.pid

Good point. This one will.
Comment 5 Tim Rice 2009-11-21 12:09:17 AEDT
Created attachment 1731 [details]
take 3

Oh rats. take2 handled all cases except the one djm mentioned.

OK, this one really works.
Comment 6 Darren Tucker 2009-11-21 13:32:54 AEDT
Comment on attachment 1731 [details]
take 3

looks good, do it!
Comment 7 Tim Rice 2009-11-21 14:37:22 AEDT
(In reply to comment #6)
> (From update of attachment 1731 [details])
> looks good, do it!

OK, I've commited the patch. It should show up in a snapshot shortly and
will be in 5.4. Marking this bug resolved.
Comment 8 Darren Tucker 2010-03-26 10:51:52 AEDT
With the release of 5.4p1, this bug is now considered closed.