Subject: Re: which file contains welcome/logon message?
To: NetBSD-help list <netbsd-help@netbsd.org>
From: The Old Bear <oldbear@arctos.com>
List: netbsd-help
Date: 05/15/2003 13:04:34
On Wed, 14 May 2003 23:39:39 -0400, I had asked:

} Well, I finally "completed" the installation on the Sparc5, set up my
} user accounts, changed the default terminal type, etc.
}
} Now what I want to do is fix the welcome message text.  On a NetBSD
} system we set up a couple of years ago, one is greeted with:
}
}      Welcome to Lizzie's Place!
}      You are about to login to komodo-dragon
}      This system is a Sparc IPC running NetBSD for sparc
}      You are connected to the ttyp0 port
}
}      login:
}
} But my new Sparc5 install welcomes one with the generic:
}
}      NetBSD/sparc (sunbear) (ttyp0)
}
}      login:
}


At 12:13 AM 5/15/03, Berndt <wulf@ping.net.au> wrote:

>You may want to read the man page on motd.
>
>cheerio Berndt


and at 12:39 AM 5/15/03, Lubomir Sedlacik <salo@Xtrmntr.org> wrote:

>motd(5) is displayed by login(1) which doesn't run at that time yet.
>
>such a file must be read by getty(8) but i don't see any obvious way of
>doing it.  that you see now is apparently printed by getty(8) itself.
>
>looking into sources and gettytab(5) manual page, "if" capability is
>what you want:
>
>    if      str          NULL     display named file before prompt,
>                                  like /etc/issue
>
>chainging the default entry in /etc/gettytab to:
>
>   default:\
>           :ce:ck:np:im=\r\n%s/%m (%h) (%t)\r\n\r\n:if=/etc/issue:
>
>and populating your /etc/issue file will print it's content to the
>terminals.
>
>you might also want to remove the "im" part of the string, which is
>responsible for the default behaviour:
>
>    im      str          NULL     initial (banner) message


Yes, my first instinct was to look at motd -- but motd controls what is
displayed *after* a user successfully logs in.  What I wanted to do was
provide an identifying welcome message so that the user (me) would know
which machine he is about to log into of several machines on our lan.

What I was looking for was indeed gettytab.  While far less elegant than
the method proposed by Lubomir Sedlacik, I took the easy way out and
just commented out the default line and substituted my desired welcome
message:


# default:\
#       :ce:ck:np:im=\r\n%s/%m (%h) (%t)\r\n\r\n:

default:\
         :ce:ck:np:im=\033[2J\033[H\r\nWelcome to Arctos Net!\r\nYou are 
about to login to %h\r\nThis system is a SUN SparcStation 5 running %s for 
%m\r\nYou are connected to the %t port\r\n\r\n:sp#9600:


My sincere thanks to both Berndt and Lubomir for their assistance.

Cheers,
Will
The Old Bear