Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Customize the Login Window text at system startup System
Tiger only hintAfter reading this hint about display a random fortune in your Login Window, I decided that I wanted to do something similar. I have three boot disks (Panther, Tiger, and Backups), and since they all look almost identical when booting and logging in (and even after logging in), I wanted to provide a way to tell which system was booted.

I was surprised to find that Mac OS X 10.4 (Tiger) disabled the LoginHook as described in the above hint. However, I found a forum post that describes how it works in 10.4. My investigation ("hacking around") leads me to believe that the LoginHook is run either after the Login Window is displayed or (more likely) after someone (anyone) logs in.

Since I wanted to be able to change the Login Window text for every login (especially for the first login after a restart), I couldn't wait for LoginHook. Since I wanted this to work in Panther, too, I couldn't use launchd (does anyone know a good launchd tutorial, though?). So, following Apple's advice, I created a StartupItem!

Perform all of the following tasks as root or using sudo:
  1. Type mkdir -p /Library/StartupItems/logintext and then cd to that directory.

  2. Create a file called logintext in that directory, containing this script.

  3. Create a file called StartupParameters.plist containing this text:
    {
      Description     = "Sets LoginwindowText";
      Provides        = ("logintext");
    }
    
  4. Check that the permissions of the directory and files look exactly like the following -- incorrect permissions will disable a StatupItem (10.4 only?):
    
    drwxr-xr-x   4 root  wheel /Library/StartupItems/logintext/
    -rwxr-xr-x   1 root  wheel /Library/StartupItems/logintext/StartupParameters.plist*
    -rwxr-xr-x   1 root  wheel /Library/StartupItems/logintext/logintext*
    
You can run that script manually by typing sudo /Library/StartupItems/logintext/logintext, or you can run it using SystemStarter:
/sbin/SystemStarter start logintext
You might need to reboot before SystemStarter recognizes this StartupItem, though. You can check the results of your current Login Window Text by typing:
defaults read /Library/Preferences/com.apple.loginwindow LoginwindowText
[robg adds: If you want an old-fashioned LoginHook executable in Tiger, this tech note describes the process...]
    •    
  • Currently 2.75 / 5
  You rated: 4 / 5 (4 votes cast)
 
[17,562 views]  

Customize the Login Window text at system startup | 7 comments | Create New Account
Click here to return to the 'Customize the Login Window text at system startup' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Customize the Login Window text at system startup
Authored by: hypert on Jun 29, '05 12:54:57PM

After submitting this, I discovered that the script I submitted with the original hint is not the best candidate for running during Startup. There are various reasons in Tiger and Panther why the results of the script are not as predictable as I would have liked.

However, the rest of the hint still stands as a valid example of how to create a StartupItem.



[ Reply to This | # ]
for laptop pseudo-security
Authored by: VassilyDolgoruki on Dec 22, '06 01:25:36PM
loginText="iSight image capture at login activen"`date "+on %m/%d/%Y at %H:%M:%S"`

This is a nice companion to the second text shown here

---
VassilyDolgoruki


[ Reply to This | # ]

Customize the Login Window text at system startup
Authored by: genericuser on Jun 29, '05 04:52:21PM

if this is 10.4 only, shouldn't it have the prefix of "10.4:" in the hint title?



[ Reply to This | # ]
Customize the Login Window text at system startup
Authored by: Impatient1 on Jun 30, '05 12:28:37AM
Check that the permissions of the directory and files look exactly like the following -- incorrect permissions will disable a StatupItem[sic] (10.4 only?):
drwxr-xr-x 4 root wheel /Library/StartupItems/logintext/
-rwxr-xr-x 1 root wheel /Library/StartupItems/logintext/StartupParameters.plist*
-rwxr-xr-x 1 root wheel /Library/StartupItems/logintext/logintext*

It seems rather odd that a property list file would require execute permission since it cannot be executed by the shell. Are you sure this won't work with the permission set as shown below?

-rw-r--r-- 1 root wheel /Library/StartupItems/logintext/StartupParameters.plist



[ Reply to This | # ]
Customize the Login Window text at system startup
Authored by: hypert on Jul 01, '05 03:53:40PM

I didn't try that, but you're probably right. I know that the directory and the script itself needed exact permissions, so I just did a "chmod -R" for everything.



[ Reply to This | # ]
Customize the Login Window text at system startup
Authored by: uurazzle on Jun 30, '05 01:09:00AM

Here is a video presentation done by the University of Utah, Student Computing Labs on launchd. It is a good tutorial on launchd...

http://data.scl.utah.edu/fmi/xsl/stream/details.xsl?-recid=200

For Mac OS X 10.4, Apple created launchd. It is one launch daemon to rule them all. Launchd does the job of all of the existing program launching mechanisms, and does it in a way that puts the least possible burden on the programs that it launches. Processes spawned by launchd don't have to worry about "daemonizing" themselves, checking for dependencies, or relaunching or keeping communication handles alive in the case of a crash.

James gave an overview of launchd and how it will change your implementation of startup, login & logout scripts. He also demonstrated Launchd Editor, which is a graphical editor for launchd property list files.



[ Reply to This | # ]
Customize the Login Window text at system startup
Authored by: t-bone on Jul 01, '05 10:49:56AM

We use our policy disclaimer text on the login window by editing /Library/Preferences/com.apple.loginwindow.plist



[ Reply to This | # ]