Re: applescript-users digest, Vol 2 #31 - 14 msgs
Re: applescript-users digest, Vol 2 #31 - 14 msgs
- Subject: Re: applescript-users digest, Vol 2 #31 - 14 msgs
- From: Rick Mann <email@hidden>
- Date: Sun, 12 Nov 2000 17:25:56 -0800
on 11/11/00 8:47 PM, email@hidden at
email@hidden wrote:
>
I'm currently looking for a way to have MySQL starting during boottime of
>
OSX. As there seems no way to make this posible with an UNIX script
>
I'm looking into applescript here..
>
What I basicly need is an script that controls "Terminal.app"
>
Does "SU" to root and starts "save_mysqld"
>
I've seen that "Terminal.app" is scriptable, but I can't seem to give it
>
input like "SU & return". I must tell that I'm not realy handy with script
>
editor..
I basically cloned one of the other directories in the
/System/Libraries/StartupItems folder. There are some notes in the Darwin
source tree regarding how to set up this directory. Basically, you need two
files. Setup the following in the StartupItems/ directory:
MySQL/
MySQL*
StartupParameters.plist
The first file contains the following:
---------------------- (Don't include this line)
#!/bin/sh
. /etc/rc.common
ConsoleMessage "Starting MySQL"
/usr/local/mysql/bin/safe_mysqld --user=<user> --password=<password> &
---------------------- (Don't include this line)
And you need to make it executable by root and not readable by anyone else
(because there's a password in it):
% chown root.wheel MySQL
% chmod 700 MySQL
Then the other file should be something like this:
---------------------- (Don't include this line)
{
Description = "MySQL Database Server";
Provides = ("MySQL Database Services");
Requires = ("Disks", "Resolver");
OrderPreference = "None";
Messages =
{
start = "Starting MySQL";
stop = "Stopping MySQL";
};
}
---------------------- (Don't include this line)
The meanings of the various items in this file are spelled out, roughly, in
the Notes.rtf file in the Startup project of the Darwin sources. If I have
time, I'll put notes on my website about how to set this up.
Make sure this file is readable by root, also.
------------------------------------------------------------
Roderick Mann email@hiddenpam