Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxl!whuxlm!akgua!gatech!ut-sally!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP Newsgroups: net.bugs.usg,net.micro.att Subject: Re: ttyname(bug) Message-ID: <212@hadron.UUCP> Date: Mon, 27-Jan-86 17:48:31 EST Article-I.D.: hadron.212 Posted: Mon Jan 27 17:48:31 1986 Date-Received: Thu, 30-Jan-86 05:34:47 EST References: <1098@ptsfa.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 45 Keywords: ttyname, ttyslot, getlogin, syscon Xref: watmath net.bugs.usg:435 net.micro.att:855 Summary: Block earlier slots in /dev. The problem, as stated, was that shutdown's ln /dev/________ /dev/syscon put syscon earlier in /dev than the tty that was being linked. To fix this permanently, you must make sure that there are no empty slots in /dev before all the tty names. Here are two ways to do this. To do either, you must first have an idea how many empty slots there are and where they are. If you say 'od -c /dev', you will get output that looks something like: 0000000 \9 \0 . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000020 \2 \0 . . \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000040 \0 \0 r p 2 0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 0000060 d \2 c o n s o l e \0 \0 \0 \0 \0 \0 \0 0000100 c \2 t t y 0 0 \0 \0 \0 \0 \0 \0 \0 \0 \0 ... The slots that have "\0 \0" in the first two columns are your empty slots. One example is "rp20" above. This gives you how many and where. One thing you could do is to create new device or regular files to fill these empty slots. You could (if you trust yourself) remove device files that are at the end of /dev and re-mknod them, so that they will re-appear at the beginning. Or you could just 'tee x y z '. This creates empty regular files. Or, if you don't want to create useless files in /dev, but are not sure you want to remove device files (after all, even _I_ make mistakes! [;-)]), you can change the links. Since (presumably) they already have the names you want them to have, you'll have to make an extra link or two as intermediates: ln ttyz8 x # right slot, wrong name ln x y # wrong slot, wrong name rm ttyz8 x ln y ttyz8 # right slot, right name rm y Of course, you will want to do both of these techniques single-user so that you can remove /dev/syscon b e f o r e you do any of this. -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}