Re: Use different pid file for second daemon?
From: Nico Kadel-Garcia (nkadel_at_comcast.net)
Date: 11/02/03
- Next message: Nico Kadel-Garcia: "Re: script shell scp"
- Previous message: nico: "Re: can't connect via ssh anymore"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sun, 2 Nov 2003 13:21:20 -0500
"Dale Dellutri" <ddelQQQlutr@panQQQix.com> wrote in message
news:bnmeuv$13p$1@reader2.panix.com...
> Is there any way to change the pid file that sshd uses when it starts?
>
> My first sshd daemon listens to the internal network port, and I need
> to run a second sshd daemon listening to the external network port and
> be able to control it separately from the first. I wanted to set it
> up as a service under RH9 using a different name. Unfortunately, the
> man for sshd specifically says that the pid file:
> /var/run/sshd.pid
> Contains the process ID of the sshd listening for connections (if
> there are several daemons running concurrently for different
> ports, this contains the process ID of the one started last).
> There does not seem to be an option to change this.
You need to create a separate init script, called say "sshd-external", and a
separate sshd_config file for it to use, say "sshd-external_config". Then
read the manual page for "sshd_config" and change the "PidFile" entry
appropriately, along with any other desired settings.
> This causes a problem because to stop the original sshd process, root
> would usually invoke:
> service sshd stop
> but this uses /etc/init.d/sshd, and the stop portion of the script
> uses the pid found in the pid file to stop the process (which would be
> the second one only).
Bingo. Yeah, you need a separate init script. Or look into how the "vsftpd"
init script does things to find multiple config files and handle them
separately: it's really quite clever.
> How can I get the second daemon to use a different pid file without
> rebuilding sshd from source? (And I don't even know how to rebuild it
> from source.) Would copying the sshd daemon to another name and
> patching the new executable work (string /usr/sbin/sshd does show
> /var/run/sshd.pid)?
No need. See above...
- Next message: Nico Kadel-Garcia: "Re: script shell scp"
- Previous message: nico: "Re: can't connect via ssh anymore"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|