Creating a Login Message for CDE Users

You want to display a message to CDE users.

Although you can specify the message to be displayed as a command line option I recommend creating a file to hold the message. The usual place for this message is in /etc/motd (Message Of The Day). By placing the message in /etc/motd users telneting into your system will get the same message.

  1. If it does not exist create the directory path /etc/dt/config/Xsession.d
  2. Create a shell script in /etc/dt/config/Xsession.d. Files in the Sun supplied directory (/usr/dt/config/Xsession.d) have four digit numeric prefixes to control execution order. I have followed that custom.
    Here is my /etc/dt/config/Xsession.d/5000.localmessage:
       #!/bin/ksh
       #
       #
       #  Purpose:        Provide local message of the day 
       #
       #  Description:    The dthello command does the work.  It displays the
       #                  /etc/motd file in a window with white text
       #                  (-fground white) on a blue background (-bground
       #                  blue).  If you omit the background option Sun's
       #                  Welcome screen will be used as the background.  To
       #                  me the message is more noticable if you change the
       #                  background.
       #
       #                  As soon as the window manager gains control of your
       #                  screen it will replace the dthello screen.  So to
       #                  give people time to read the message the script
       #                  sleeps before exiting.  Make sure that the sleep
       #                  time is sufficient for people to read the message.
       #                  Long messages will require long sleep times.
       #                  
       #                  dthello does not support formatting of your
       #                  message.  Spacing in the file will be collapsed.
       #                  
       #                  Also, at the top of the screen will be displayed
       #                  the following 2 lines:
       #                     Starting the
       #                     Common Desktop Environment
       #
       #  Invoked by:     /usr/dt/bin/Xsession
       #
       #  Product:        @(#)Common Desktop Environment 1.0
       #
       #  Note:           Please refer to the dthello(1) man page for 
       #                  more information.
       #
       #
       #
       #
       ################################################################
    
       /usr/dt/bin/dthello -fground white -bground blue -file /etc/motd &
       /usr/bin/sleep 20
    		  
  3. Make the script executable,
       chmod 555 /etc/dt/config/Xsession.d/5000.localmessage
    		  
  4. Edit /etc/motd to contain the message you want displayed.

This web page is Copyright © 1997 - 2017, Stephen Hinchey
If you have comments or additions for these web pages please direct them to webmaster @ barbary.com