LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Copying Arch agetty information to Kubuntu (https://www.linuxquestions.org/questions/linux-general-1/copying-arch-agetty-information-to-kubuntu-4175436440/)

Raevyn 11-09-2012 12:51 PM

Copying Arch agetty information to Kubuntu
 
1 Attachment(s)
Howdy!

I was wondering if there is a way to copy the information that Arch seems to display in the console into other distributions?

I did research on this and I discovered that what is shown before the prompt in the console is generally in /etc/issue text file. I went there in Kubuntu and I see it and can even make changes, but when I ran a copy of Arch in my VM, it shows the custom dialog, but it is not in the /etc/issue file. Well, there is something there:

ArchBang Linux \r (\l)

which in reading up on the various optional switches does not seem to make the dialog I am seeing. I am sure there is a file somewhere I can edit and it could have something to do with Arch using agetty but again, I cant seem to find another location for its configuration yet either.

I enclosed a screenshot of what dialog I am meaning in case that helps those that are wondering what I am talking about LOL.

Thanx for any help or information :)

andrewthomas 11-10-2012 06:24 AM

What is displayed at the console prompt can be controlled with ~/.bashrc
On my Arch install I have a line in my ~/.bashrc
Code:

PS1='[\u@\h \W]\$ '
displays
Quote:

[lxde@asus ~]$
username@host current directory

When I edit that line in my ~/.bashrc
Code:

#PS1='[\u@\h \W]\$ '
PS1='[ArchLinux \u@\h \W]\$ '

displays
Quote:

[ArchLinux lxde@asus ~]$
on my machine

Raevyn 11-10-2012 08:48 AM

hmm thank you.

I tried that script string in bash.rc but it doesnt seem to work. It just shows what it always has before, so perhaps there is a package installed on Arch that allows that other information to be displayed?

Oh I mean to add that I also tried adding it into the /etc/bash.rc file as well. Not a change

andrewthomas 11-10-2012 09:08 AM

~/.bash_profile
Code:

# /etc/skel/.bash_profile

# This file is sourced by bash for login shells.  The following line
# runs your .bashrc and is recommended by the bash info pages.
[[ -f ~/.bashrc ]] && . ~/.bashrc

~/.bashrc
Code:

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='[ArchLinux \u@\h \W]\$ '

Do you have a .bashrc file in your home directory?
(note the . : it is a hidden file.)

EDIT: what is the output of
Code:

ls -al /etc/skel

Raevyn 11-10-2012 11:55 AM

Here is what I have showing on that command:

ls -al /etc/skel
total 28
drwxr-xr-x 2 root root 4096 Nov 10 10:50 .
drwxr-xr-x 125 root root 12288 Nov 10 10:42 ..
-rw-r--r-- 1 root root 220 Sep 19 06:40 .bash_logout
-rw-r--r-- 1 root root 3637 Sep 19 06:40 .bashrc
-rw-r--r-- 1 root root 459 Nov 10 10:49 .profile

towheedm 11-11-2012 12:23 AM

That is not controlled by your default prompt. If it was, it certainly would generate a lot of text after each and every command.

The login process on a VT is thus:
  • After you switch to a console, init calls your getty (Get TTY) program, in this case agetty. Your getty then reads your /etc/issue file (if present) and displays it's contents before showing the login prompt. The is responsible for getting ONLY your username.
  • Once you have entered your username and pressed <Enter>, your getty then does an exec call to your login program (in alsmost all cases, it's login). The login program verifies your password using the information in /etc/passwd and /etc/shadow if needed. It also read several other files, amongst those, /etc/motd.
  • The contents of /etc/motd (Message of the day), if present is then displayed. Your login program, then execute any initialization scripts for your shell.

The short of it all is, the screenshot shows the contents of your /etc/motd file. Copy it to whatever distro you wish if you like it, or create your own. Note though, on Debien and Debian-based distros, the /etc/motd file is a symlink to /var/run/motd and is re-created on every system boot by the contents of the /etc/motd.tail file.

A search using your favorite search engine on customizing your motd:
http://www.mewbies.com/how_to_custom...e_tutorial.htm
http://www.howtogeek.com/104708/how-...ge-of-the-day/
https://wiki.archlinux.org/index.php/Motd

Code:

man agetty
man login
man motd

If you would like to colorize your pre-login banner, check out this thread: http://www.linuxquestions.org/questi...onsole-948038/

Hope this helps you.


All times are GMT -5. The time now is 08:27 PM.