Re: /dev permissions
CD Rasmussen wrote:
> Ian, this poses an interesting problem. When one is running mgetty,
> minicom and diald (with ppp/slip). There are problems locking the
> modem device. Without a consistent locking convention the modem
> simply will not work since there are devices competing for it. Things
> all work together with mgetty since one standardizes on ttyS?. The
> author of mgetty makes it clear that the 2 devices do behave
> differently enough to make a difference in which one mgetty works
> right on. It will not function correctly on cua.
Actually, with recent Linux kernels, it should even run on "cua*" as well,
but I didn't test it (I didn't see the need to test it, since it runs well
> Mgetty runs on many different Unix systems. I think it is too
> important a package to declare that it must be written wrong since it
> disagrees with the philosophy espoused below.
I hope so :)
Anyway, I don't think this is an "importance" issue, but a "portability"
one. Tytso, the author of the serial driver, said himself that he
considers the ttyS/cua - pairs a dreadful hack for badly written
programs... (I offered to add some support for a special ioctl() making
mgetty run on ttyS1 with applications dialing happily on cua1, but
> I have been hoping to release an mgetty package after our release
> since Debian and Mgetty will both release about the same time.
The current Mgetty release is 0.98 as of August-something. I consider
this the first release really ready for binary inclusion into some Linux
distribution, because nearly all options can be set at run-time, no need
for the ever-annoying recompilations.
> You do point out that ttyS* should be used by login and thus
> getty. Does this make the case that since the port is essentially
> owned by a modem getty it would be acceptable to use ttyS* for all the
> outgoing modem use as well?
Hmm? ttyS* is used by getty and login, but I do not understand the
implications to outgoing modem traffic.
> Alternatives would be to modify all dialout programs to write lock
> files for both devices or to see if they would tolerate a symlink from
> the cua* to the ttyS*.
Actually, when mgetty runs on ttyS*, no dialout (no!!) is *possible* on
cua*, because the kernel will return "errno = EBUSY", "device busy".
(Sym)Linking devices is always a bad idea, because it may lead to many
unexpeced and hard-to-find collisions on the modem device.
> Lock files have got to be consistent across the board for all debian
> packages that use the modem. So far, I expect that list to be uucp,
> kermit, minicom, mgetty, diald, efax, slip and ppp.
Yes, that's about it.
BTW, another thing that you seemed to have overlooked: there is no
obstacle at all to have *all* programs run *all the time* on ttyS1,
even when not using any getty, or when using getty_ps instead of mgetty
(getty_ps could work fine on a shared device, w/o the need for device
pairs, in earlier releases, I would be very astonished to hear if
it wouldn't do that anymore).
> From: Ian Jackson <firstname.lastname@example.org>
> To: debian-devel@Pixar.com
> Subject: Re: /dev permissions
> J. H. M. Dassen writes ("/dev permissions"):
> > Aleph One wrote in c.o.l.a.:
> > --
> > [...]
> > On a side note many
> > distributions have the correct premission in the /dev/cua devices
> > but not on their equivalent /dev/ttyS devices. This is the case of
> > debian 0.93. To fix chown root.dialout /dev/ttyS*; chmod o-rwx
> > /dev/ttyS*. Make sure that this does brake your other serial devices
> > such as your mouse.
This "chown" thing can be easily achieved by running mgetty [on the modem
ports] because it will chown the devices to the right values.
> > [...]
> > --
> > Can someone check if this is true?
> The ttyS* devices are not for dialout. Dialout should use the cua*
This depends on the getty you use. "cua*" is a hack, invented to be able
to use dumb dial-in/dial-out programs that don't care about locking
conventions, but, fortunately, all recent programs do it right.
If you use programs that follow the proper locking conventions, "cua*"
isn't needed anymore, but won't harm either (you're basically free to use
whatever you like).
If you use mgetty, you must not use "cua*" anymore, because mgetty's
features effectively make use of "cua*" impossible. I know that it's
somewhat against the "one device per purpose" philosophy, but there is
no way around it, at least if you don't want to undergo crazy efforts
like "getty_ps" does it to get it done with Linux-specific ioctl()s
that do not work half the time [how many people with getty_ps problems
do you know...?]
> ttyS* devices are for dialin and login (and sometimes for mice) should
> generally be owned by root. They should not be owned by dialout.
Depends on the getty you use.
> If the person telling you this wrote it in cola (.answers? .announce?)
> they probably need to be informed that it's wrong so that they can
> change their document.
This is only right in certain circumstances.
Final exams *DONE* -- still no time, have to earn a living :(
Gert Doering - Munich, Germany email@example.com
fax: +49-89-3545980 <---new!!! firstname.lastname@example.org