Can't get pidfile to work in rc script

Matthew Seaman matthew at FreeBSD.org
Fri Sep 21 05:06:28 UTC 2018


On 21/09/2018 06:57, Lee Brown wrote:
> I'm trying to get 2 separate sshd's running.  I've created
> /etc/rc.d/sshd_alternate but it always uses /var/run/sshd.pid and not
> /var/run/sshd_alternate.pid.  I tried
> 
> sshd_alternate_pidfile="${pidfile}"
> and
> procname="sshd" / procname="/usr/sbin/sshd"
> 
> to no avail.  Can somebody provide some assistance, I'm sure this is simple
> but I just can't fathom it.

Did you create /etc/ssh/sshd_config.alternate?  In there you'll need to
at minimum configure sshd to use a different pidfile and to listen on
alternate IPs / port numbers.  It's the pidfile setting in the config
file that sshd will use -- the setting in the rc.d script just tell the
rc system where it can read the daemon's PID in order to signal it.

Then you'll need the alternate rc.d startup script which you already
seem to have in hand.

	Cheers,

	Matthew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20180921/968afedd/attachment.sig>


More information about the freebsd-hackers mailing list