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

Start Classic from the command line Classic
You can start the Classic Environment from the command line (i.e., the Terminal) by typing:
  open -a /System/Library/CoreServices/Classic Startup.app
My default shell in the Terminal is bash, which supports aliases, so I have added the following line to my .profile:
  alias classic='open -a /System/Library/CoreServices/Classic\ Startup.app'
This way, I can start the Classic environment from the Terminal simply by typing classic.

[Editor's note: If you use the default tcsh shell, aliases are also supported (search the site on 'alias' for a few articles). The alias command in tcsh would look like alias classic 'open -a /System/Library/CoreServices/Classic\ Startup.app']
    •    
  • Currently 2.00 / 5
  You rated: 2 / 5 (3 votes cast)
 
[4,998 views]  

Start Classic from the command line | 7 comments | Create New Account
Click here to return to the 'Start Classic from the command line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Re: Command Line Classic
Authored by: Paul Burney on Nov 29, '01 10:30:54AM

I frequently have problems with classic networking and with the Microsoft Office Suite. Since many office problems stem from corrupt libraries, I delete them before starting classic. Since the TCP/IP prefs are generated by OS X when classic launches, I also delete them. Here's the script I use to start classic:

#!/bin/sh

# Remove bad prefs from Classic Volume

echo "Removing bad prefs and extensions from Classic volume...";
rm -rf /Volumes/Boot/System Folder/Preferences/TCP:IP Preferences;
rm -rf /Volumes/Boot/System Folder/Extensions/Microsoft*;

echo "Starting Classic...";
open /System/Library/CoreServices/Classic Startup.app & ;

I have an alias to that script called "classic" and I have that script set to run on login.

HTH.



[ Reply to This | # ]
stopping Classic
Authored by: imacusr on Nov 29, '01 12:03:24PM

So is there a way of safely shutting down Classic from the terminal? I'd rather do it there than have to keep System Preferences.app open all the time just to be able to safely shut down Classic.



[ Reply to This | # ]
stopping Classic
Authored by: level9 on Nov 29, '01 01:24:42PM

It's my understanding that if you...

kill <PID of Classic>

it's the same as quitting it from the Prefs Panel. kill <PID> is the same as cmd-q, or Quit from the menu. Of course, if there are any alerts or dialog boxes, Classic will not quit. There is always kill -9 <PID>, but as a last resort. Maybe someone else can shed some light...



[ Reply to This | # ]
stopping Classic
Authored by: babbage on Nov 29, '01 03:31:52PM

But should kill -9 [a] be the preferred way to cleanly shutdown a big application like Classic, and [b] is kill -9 guaranteed to bring it down? I ask because I'm used to using kill & kill -9 in Unix to kill off offending shell programs & the occasional frozen Netscape process, but I still don't quite trust it in MacOSX.

As a case in point, Internet Explorer keeps crashing on me and nothing I can do will manage to kill the hung process -- "quit" from the dock, "force quit" from the dock or apple menu, kill or kill -9 from the terminal, and finally at the end of desperation "sudo kill -9" from the terminal. Nada.

Every time IE crashes this way -- and it has happened about half a dozen times over the past month -- it freezes up so stubbornly that nothing I can do can get rid of it, and as a result I can't log out or shut down the system. The best I can do is kill off the window manager process -- thus throwing a very unclean logout as all running programs crash & quit (except of course IE, which happily keeps skating along in zombie land) -- and then log back in in console mode so that I can manually kill off as many processes as possible before unplugging the computer.

This sucks.

Is anyone else having trouble with problems with applications getting stuck like this? It's driving me nuts and I can't figure out how to resolve the problem. Any suggestions would be greatly appreciated...



[ Reply to This | # ]
stopping Classic
Authored by: level9 on Nov 29, '01 06:49:25PM

I can only go by what little I've learned in the last 8 months or so...but I have yet to have kill -9 *not* kill a process on either of my three OSX boxes. kill -9 is not a "clean" way of stopping any process, basically it stops it dead in it's tracks...no time for clean up, etc. That's originally why I said I use it as a last resort. Kind of like force-quitting an app in OS 9 (and earlier), if it worked back then. I work with people that force-quit an app the *instant* it doesn't respond, so I'm not a big fan of force-quitting, unless absolutely necessary.

It's funny that you mention IE, this is the only app I've had to kill -9, but only twice in about 4 months.



[ Reply to This | # ]
stopping Classic
Authored by: babbage on Nov 30, '01 01:04:23PM

I've been using Unix for years, and kill -9 is basically always the method of last resort -- if a process hangs, try killing it normally and if that doesn't work then try kill -9, and in the rare case try running kill or kill -9 as root, but with great hesistation. Ususally a regular kill will work, and if not kill -9 does; having to go in as root basically never happens.

But that's exactly why this IE problem is bugging me so much -- even the last ditch method isn't doing it. Force quit doesn't work either, but I suspect that at some level the two commands are doing the same thing (maybe force quit is a gui version of kill, I don't know). I have never encountered an application that wouldn't respond to this, and it unnerves me that it can happen in OSX.

I'm told that on a traditional Unix, this is a sign that the hung process is lodged in the kernel and waiting for some kind of system I/O -- disc or network access -- and may be a sign of hardware failure. That could be the case here -- god I hope not but it's possible -- but I've got a basically brand new hard drive, and no other problems are coming up aside from IE. It has me wondering of either IE has some kind of *very* serious bug in it somewhere, or more unnervingly there is a problem with the Darwin kernel that is allowing this to happen. If it's just IE, no big deal, I can just stop using it until an update comes out. But if the problem is in the kernel, and the api that IE is hitting and other things probably hit as well.... yech, that's scary.

But in any event, this has been going on for like a month now and I still can't figure out why. I've asked around a little bit but no one else seems to have had this problem, as near as I can tell. I'd really like to know what's going on here...



[ Reply to This | # ]
stopping Classic
Authored by: ellis on Nov 30, '01 12:35:28AM

A command line AppleScript should safely shut down Classic (sends a quit event):

osascript -e 'tell app "Classic Support" to quit'

If Classic isn't running though, it may try to start up (before quitting). Likewise, to start up Classic:

osascript -e 'launch app "Classic Startup"'



[ Reply to This | # ]