Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Use different pid file for second daemon?
- Dale Dellutri
October 28, 2003, 7:10 pm
rate this thread
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:
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.
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).
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
- Nico Kadel-Garcia
November 2, 2003, 6:21 pm
Re: Use different pid file for second daemon?
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.
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.
No need. See above...
- » SSH connection is loose after few inactivity seconds
- — Previous thread in » Secure Shell Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum