On 1999-Dec-16 10:07:49 +1100, Poul-Henning Kamp <[EMAIL PROTECTED]> wrote:
>In message <[EMAIL PROTECTED]>, Peter Jeremy writes
>:
>>It can do that now.  Add the following lines to /etc/ttys:
>>
>>sshd  "/usr/local/sbin/sshd" none on
>>inetd "/usr/sbin/inetd -Ww" none on
>>syslogd       "/usr/sbin/syslogd" none on
>>
>>(This ability has always been present, but is now documented).
>
>Yes, but apart from the highly unintuitive name "/etc/ttys"

I agree that it's non-intuitive, but I doubt that any attempt to
change the name would survive very long.

>I would prefer if the lines could be added to /etc/ttys somewhat
>like:
>       sshd "/usr/local/sbin/sshd" none ondemand
>
>And then we could
>       telinit -on sshd
>       telinit -off sshd

This looks nice.  The major problem I see is coming up with a secure
mechanism for passing the daemon name from telinit to init.  (And the
issue of whether the state should be persistent over reboots - which
is regularly hashed to death whenever DEVFS comes up).

And, whilst it's even less intuitive than /etc/ttys, we already have
equivalent functionality now (assuming you have an entry in /dev for
a non-existent device).  The state in /etc/ttys always is `on'.

Using sshd as an example:

To enable:
        rm -f /dev/sshd
        kill -HUP 1

To disable:
        ln -s /dev/some_device_that_isnt_configured /dev/sshd
        kill -HUP 1

(This works because init will always try to open /dev/sshd.  If
the open returns ENXIO, it will skip that line.  If the open
succeeds, or fails with any other error (ie ENOENT) the line
is accepted).

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to