Can't get pidfile to work in rc script

Lee Brown leeb at ratnaling.org
Fri Sep 21 05:38:49 UTC 2018


On Thu, Sep 20, 2018, 10:06 PM Matthew Seaman <matthew at freebsd.org> wrote:

> 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
>
Thank you Matthew,

Yes a separate port and config as you correctly surmise.

My assumption was that the rc  framework created the pidfile.  I'm going to
re-read the rc.subr manpage tomorrow as I obviously misunderstood how it
works.

Thanks to all - lee

>
>


More information about the freebsd-hackers mailing list