startup files


The MySQL manual list something about copying the mysql.server file to the location were your system has its startupfiles, where are those on OSX beta

Take a look at this folder... you'll find plenty of stuff here.


Take a look at the format of things and you'll get the idea fairly quickly. I found a tutorial somewhere, but can't remember where. Anyway, I can post a better explanation tomorrow, as I'll be in front of an X box (pun intended) that I have setup WebCrossing to start automatically on startup.


That was my thought (rummaging in /System/Library/StartupItems/ but i can't seem to get anything to work.
I've made a dir called 'mysql' with 2 files in thus:

-r--r--r-- 1 root wheel 195 Nov 25 18:18 StartupParameters.plist
-rwxr-xr-x 1 root wheel 93 Nov 25 18:21 mysql

the mysql file seems to have the same permissions etc as the other startupitems files (e.g. Apache).

mysql contains:
# Start mysql
. /etc/rc.common
ConsoleMessage "Starting sql"

and StartupParameters.plist contains
Description = "mysql server";
Provides = ("mysql");
OrderPreference = "None";
Messages =
start = "Starting mysql server";
stop = "Stopping mysql server";

stuck! can't find any errors in logs - any ideas?
(also tried copying the mysql.server file there too :()

Ok, here you have my setup:


directory contents: (ls -lF)
-rwxr-xr-x 1 dani admin 103 Oct 25 13:30 MySQL*
-rw-r--r-- 1 dani admin 231 Oct 25 12:20 StartupParameters.plist


. /etc/rc.common

ConsoleMessage "[Arrencant daemon MySQL...]"
/usr/local/bin/safe_mysqld &

Description = "mysql";
Provides = ("MySQL");
Requires = ("Resolver");
OrderPreference = "None";
Messages =
start = "[Arrencant daemon MySQL...]";
stop = "[Arrencant daemon MySQL]";

There are subtle diferences with what you have... =)


[Edited by dani++ on 11-27-2000 at 03:16 PM]
I had trouble getting stuff in /Library/StartupItems working. I would copy the files other people have posted here, but it never seemed to work.

The trick, I found, was in the line-feed characters. I created my scripts using BBEdit, saved using Macintosh line feeds. It appears (I think, anyway) that if you the script will not execute properly.

To see why, open Terminal and do vi script_name. You'll see that the entire script is treated as one comment line with ^M charcters instead of proper line feeds. (This is because Unix uses \n characters for line feeds and the Mac uses \r.)

So, when you build your script, either use BBEdit to save as a Unix file, or use a Unix tool (vi, pico, etc.) to create the script.

Also, you should probably change the owner of the file to root, using "sudo chown root file_name"