Date: Tue, 08 Jan 2008 21:04:02 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: ivan dimitrov <dimitrovi58@yahoo.com> Cc: freebsd-questions@freebsd.org Subject: Re: how to start one daemon twice from the rc.conf? Message-ID: <4783E542.5090206@infracaninophile.co.uk> In-Reply-To: <18977.72671.qm@web56812.mail.re3.yahoo.com> References: <18977.72671.qm@web56812.mail.re3.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
ivan dimitrov wrote:
> How to start two sshd with different configs from the rc.conf?
>
> Do i have to write a secondary /etc/rc.d/sshd,
> for eg. /etc/rc.d/sshd2 and put sshd2_enable="yes" in the rc.conf
> or there is another way to do this?
No -- that's pretty much the way of it unless the rc file
specifically has support for multiple sessions (eg. /etc/rc.d/jail)
You need to do more than just rename the file though -- you will
need to change the line:
name="sshd"
to read
name="sshd2"
plus you'll need to change the line
command="/usr/sbin/${name}"
to say
command="/usr/sbin/sshd"
and add
sshd2_enable="YES"
sshd2_flags="-f /etc/ssh/sshd2_config"
to /etc/rc.conf -- assuming you're happy to use the same keys as
for the other sshd instance that's pretty much all that's necessary.
In the general case though you'ld have to do a sweep through the
file and change any variables from sshd_foo to sshd2_foo -- usually
there are a number of references like that, and /etc/rc.d/sshd is
quite unusual in not having them.
Cheers,
Matthew
- --
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHg+VC8Mjk52CukIwRCC7AAJ9Q4ckg6xfyB1Sv2gGqnMpPiAIKIwCdHo4Z
HLoVnrPpraFIDFW8jGA9ilw=
=Hwqd
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4783E542.5090206>
