Tips from RHCEs

Featured Article: Automatically Displaying System Console Messages on your Desktop

Henry Maine, RHCE

There are times when it keeping an eye on log messages that are reported in '/var/log/messages' is useful.  Although you can do this by running a gnome-terminal session and using the 'tail -f' command, the 'xconsole' application provides a special terminal window specifically for this purpose. This article will walk you through the (simple) process of setting up 'xconsole'.

To run 'xconsole', type 'xconsole' from the command line of any gnome-terminal session.  The only important thing to remember is that the PAM console module assigns ownership of the system console device to the user that has logged in from the system console, so it is important to launch xconsole as this user.  You can view the current ownership of the console device using the commmand:

	ls -l  /dev/console

If you want 'xconsole' to launch automatically whenever you log in to an X Window session, create a file called 'xconsole' in the directory '/etc/X11/xinit/xinitrc.d' that contains the following:

	# Start an xconsole session in the bottom, right corner of the desktop. 
	xconsole -geometry 800x100-0-50 & 

Be sure to make the file executable:

	chmod a+x /etc/X11/xinet/xinitrc.d/xconsole 

The next step is to configure the system logging daemon to send messages to send log messages to the system console device.  Edit the file '/etc/syslog.conf' and look for the line that reads:

	*.info;mail.none;authpriv.none;cron.non  /var/log/messages 

and ADD the following line immediately below it:

	*.info;mail.none;authpriv.none;cron.non  /dev/console 

You should now have two lines that read as follows:

	*.info;mail.none;authpriv.none;cron.non  /var/log/messages 
	*.info;mail.none;authpriv.none;cron.non  /dev/console 

Save your changes and restart the system logging daemon:

	service syslog restart 

If you have an 'xconsole' window running when you do this, you should see the startup messages from 'syslogd' appear in the 'xconsole' window.