From: Dan Cross <cross@math.psu.edu>
To: 9fans@cse.psu.edu
Subject: [9fans] A modified version of /rc/bin/C
Date: Sat, 15 Feb 2003 18:01:06 -0500 [thread overview]
Message-ID: <200302152301.h1FN16M07647@augusta.math.psu.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
A while back, I couldn't figure out why my `C' command couldn't find
the consoles on my console server. Russ was quick to point out that I
needed to mount /srv/consoles in namespace.$sysname. However, I didn't
like that because it seemd like something one shouldn't *need* to do.
Instead, I modified C to import '#s' from the console server, and mount
'#s/consoles' directly on the client. I like this better, since C now
works everywhere, without any sort of dependencies on the namespace
from the server.
Another thing that bothered me about /rc/bin/C was that one needed to
modify it to explicitly set one's console server. That struck me as
kind of bogus; shouldn't there be a more systematic way to do it? So
today, I modified /rc/bin/C on my system to get the name of the console
server using ndb/ipquery. This way, I can set up multiple console
servers all over the network, and tell C where they are by putting
console=foo paits into /lib/ndb/local and friends. This is much
easier, in my opinion, than putting local policy into a script in
/rc/bin. It also makes maintenance of C itself easier (not that it
really needs to be maintained all that much; it's a pretty simple
script). Using ndb/ipquery makes it sensative to what network I'm on,
and allows me to set a default.
Anyway, here's my version; Russ, how would you feel about putting this
into the distribution?
- Dan C.
[-- Attachment #2: Type: text/plain, Size: 734 bytes --]
#!/bin/rc
rfork n
switch($1){
case -r
shift
opt=''
case *
opt=-r
}
# change to console server
# may want to use a switch on the
# machine name to support multiple
# console servers
server=`{ndb/ipquery sys $1 console | sed 's/console=//'}
if (~ $server '')
server=$sysname
if(! test -e /mnt/consoles/$1){
switch($sysname){
case $server
mount /srv/consoles /mnt/consoles
case *
mntgen
import $server '#s' /n/$server^srv
mount /n/$server^srv/consoles /mnt/consoles
}
}
if(! test -e /mnt/consoles/$1 && test -e /srv/consoles)
mount /srv/consoles /mnt/consoles
if(! test -e /mnt/consoles/$1){
echo console not found
exit 'console not found'
}
con -l $opt /mnt/consoles/$1
reply other threads:[~2003-02-15 23:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200302152301.h1FN16M07647@augusta.math.psu.edu \
--to=cross@math.psu.edu \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).