# /etc/issues



## Lance (Jul 30, 2003)

Okay, well I'm assuming that there is a script that gets loaded before /usr/bin/login and just performs 'cat /etc/issues'. This being an assumption...

Sooo, does anyone know how to get /etc/issues working? And if that file exists, what it is? Guessing it's in /etc/ also.

Hmm, anyone...?


----------



## slur (Aug 3, 2003)

I believe you have /etc/issues.

I don't see this file on my system, and I can't imagine why you do.


----------



## michaelsanford (Aug 3, 2003)

Please `cat /etc/issues > this_forum` so we can see it.


----------



## Lance (Aug 4, 2003)

Erm, what I'm trying to say is, how would I get /etc/issues to work? I created /etc/issues myself, but it doesn't load before a login prompt. (like it should) I'm betting /etc/issues is just printed before login by some shell script that runs on start of a telnet/SSH connection. So that shell script runs, sets up some things, prints /etc/issues, then runs login. Then after login, there is the script that prints login attempts, mail info, as well as the contents of /etc/motd.

Soo, any help here...?


----------



## slur (Aug 5, 2003)

Why do you expect a randomly created file that happens to be named "issues" and happens to be in /etc should do anything at all? I'm just curious where you heard that /etc/issues was a meaningful file. I've used a bunch of Unix systems and never heard of this file.

Things in /etc don't automatically get loaded before the login prompt. That's not the meaning of /etc. Things in /etc are for the most part configuration files. On many Unix systems items in /etc/rc.d or /etc/rc.local are loaded at startup. This is not the case on Mac OS X.

Mac OS X does use some of the /etc/rc.* files at startup, but you shouldn't mess with them. Instead you should use the supported methods of loading things at startup, which involves creating folders in /Library/StartupItems and modifying the /etc/hostconfig file.

Before anyone here can instruct you any further it would be best if you could describe what you're trying to accomplish and/or the results you are expecting.


----------



## elander (Aug 5, 2003)

Well, actually "/etc/issues" is a file that is used on some Linux systems to provide a message that gets displayed for remote logins via telnet. It usually tells the user what the time is, and when they logged in the last time (giving the user logging in a chance to discover if someone else has logged in to his account since he himself logged in).

I can't remember how to do that in Mac OS X, but I'll come back when I remember/find out.

edited: Found it! Check out "/etc/motd", that's the file containing the welcome message for telnet in Mac OS X.


----------



## Lance (Aug 5, 2003)

No, nobody seems to get it. I'm not talking about /etc/motd, and I'm not saying the file itself is important. There is a file, that /usr/bin/login executes before the prompt itself. The script that controls /usr/bin/login has a line that says 'cat /etc/issues' to print it out before it prints the regular 'login: ' prompt. Where is that file?! The one that controls login?!

Sorry to rant, but you guys completely misread what I said.


----------



## elander (Aug 6, 2003)

> _Originally posted by Lance _
> *No, nobody seems to get it. I'm not talking about /etc/motd, and I'm not saying the file itself is important. There is a file, that /usr/bin/login executes before the prompt itself. The script that controls /usr/bin/login has a line that says 'cat /etc/issues' to print it out before it prints the regular 'login: ' prompt. Where is that file?! The one that controls login?!
> 
> Sorry to rant, but you guys completely misread what I said. *



Well, if you know that there is a file that says 'cat /etc/issues', how do you know that? I'm pretty sure that you are wrong, and that there is no such file with that command in darwin.

What controls what gets run at login depends on how you login. You can look att '/etc/ttys', or '/etc/rc' or you can create what Apple calls a "LogInHook" (see here: http://clc.its.psu.edu/Labs/Mac/resources/authdoc/loginhook.aspx), and there are other options too.

Where have you seen the 'cat /etc/issues'? On some Linux system, or have you actually seen it in Darwin?

If you explain a little further what it is you are trying to accomplish it would make it a lot easier to help. Be as precise as you can, otherwise this thread can go on for ever...


----------



## rhg (Aug 7, 2003)

On Linux it is the getty process which prints the /etc/issue file.

Note: /etc/issue - not /etc/issues

There is also the /etc/issue.net file which is used for network login. It is printed by the telnetd process.

It is not a shell script but a text file which is parsed and then output. It may contain some tokens which are replaced dynamically, for example @D (current date), @T (current time), @S (system name), @V (operating system version) as well as the usual \ escapes such as \t or \n.

However, on Mac OS X (i.e. on BSD systems in general?) this doesn't seem to be implemented like this. I couldn't find any reference to /etc/issue or /etc/issue.net in /usr/libexec/getty or /usr/libexec/telnetd. So my conclusion is that on Mac OS X there is no /etc/issue mechanism available.

Hope this helps


----------



## Arden (Aug 7, 2003)

Lance, I think you've got issues.


----------



## Lance (Aug 7, 2003)

Thank you, rhg and elander. You guys at least seem to know what i'm talking about. And yes, I'm used to Linux.


----------



## Eckhart (Aug 8, 2003)

> I've used a bunch of Unix systems and never heard of this file.



Yeaahh, all of them!! Except for those unpopular ones, like Linux, System V and an irrelevant number of derivats 



> Soo, any help here...?



Let's see Lance... Rhg is perfectly right about any point he makes. Especially the last one that '/etc/issue' is not implemented in BSD-alikes.
Yet - better: therefore - a number of BSD users tried to invent some workarounds, of which at least one I know of should work for MacOSX. Look at '/etc/gettytab' and you'll find the following entry:



> default:\ :cb:ce:ck:lc:fd#1000:im=\r\nDarwin/BSD (%h) (%t)\r\n\r\n:sp#1200:



Try changing it to:



> default:\ :cb:ce:ck:lc:fd#1000:if=/etc/issue:sp#1200:



Instead of the standard input message (im) it should read an input file (if). But be careful, for the time I heard of it, in FreeBSD you had to manually adjust the getty source code to allow the 'if' switch. With a bit of luck, Apple has done it for you. If not, it'll be slightly more work.

And another problem: the changes you make here, of course, only have an impact on the ttys getty handles. Telnetd has it own hard-coded directives and might not rexpect the if-option (although there should exist patches about it for at least telnetd).

In any case: Coding /etc/issue into a bsd system means _work_ which in my eyes does not equal the benefits of an /etc/issue file.
But if you like to mess around, let us know what you'll get out of it


----------



## Solaris (Aug 25, 2003)

Also the sshd_config file has config parameter "Banner" that is usually set to /etc/issue


----------

