image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old January 1st, 2003, 08:40 PM
wiz wiz is offline
Registered User
 
Join Date: Jul 2002
Location: Sol
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
wiz is on a distinguished road
[REQUEST] - HowTo setup startup services on Jaguar (10.2.3)

could someone ceate a [HowTo] on this?

thanks

for some reason my mysql setup won't work.

i've added the MYSQL=-YES- in the /etc/hostconfig

and created the folder /Library/StartupItems/MySQL
created file MySQL
created file StartupParametres.plist



but still it dosen't work

the problem seems to be,
the MYSQL env var is not not being read or its set to -NO- although i explictly set it to -YES-
and hence the mysqld is never initialized

otherwise everything is fine

Last edited by wiz; January 1st, 2003 at 08:50 PM.
Reply With Quote
  #2  
Old January 2nd, 2003, 05:17 PM
slur's Avatar
Geek / Hedonist
 
Join Date: Dec 2000
Location: Florence, MA
Posts: 542
Thanks: 0
Thanked 0 Times in 0 Posts
slur is on a distinguished road
MySQL from Entropy?

Did you install MySQL using the packages available at entropy.ch? These make it a lot easier.

So to troubleshoot...

- In my (entropy) installed version of MySQL there's also a "Resources" folder containing an "English.lproj" file. I'm not sure if this is necessary.

- The MySQL script has to be executable. Is it?

- The MySQL script should contain something like this:

#!/bin/sh

. /etc/rc.common

if [ "${MYSQL:=-YES-}" = "-YES-" ]; then

ConsoleMessage "Starting MySQL database server"

cd /usr/local/
REALDIR=`perl -e 'print readlink "mysql"'`
cd $REALDIR

ulimit -n 6000

if [ -e ./bin/safe_mysqld ]; then
./bin/safe_mysqld --user=mysql &
elif [ -e ./bin/mysqld_safe ]; then
./bin/mysqld_safe --user=mysql &
else
ConsoleMessage "Found neither safe_mysqld nor mysqld_safe"
fi

fi


- My StartupParameters.plist file has these contents. How does it compare to yours?:

{
Description = "MySQL database server";
Provides = ("MySQL");
Requires = ("Resolver");
Preference = "Late";
Messages =
{
start = "Starting MySQL";
stop = "Stopping MySQL";
};
}
__________________
|
| slur was here
|

check out my creative music software
Reply With Quote
  #3  
Old January 3rd, 2003, 05:41 AM
LordCoven's Avatar
Registered User
 
Join Date: Dec 2001
Location: Germany
Posts: 349
Thanks: 0
Thanked 0 Times in 0 Posts
LordCoven is on a distinguished road
You also might want to check ....

.... if you can start / stop the service manually with the SystemStarter command:

SystemStarter start MySQL
or
SystemStarter stop MySQL

If you get any errors with this (which I did), then you'll have to get this to work first. In my case, the script was using the default MySQL environment for startup, whereas the version directly from MySQL has to be configured slightly different. I can post my version of the script here later if you want.

C
__________________
------------------============------------------
(Alu)PowerBook 17", 1.67Ghz, 1.5Gb, 128Mb ATI
[clears throat] Ahem - SWEEEEEEEEET
IT'S SPANKING!
Reply With Quote
  #4  
Old January 3rd, 2003, 03:57 PM
wiz wiz is offline
Registered User
 
Join Date: Jul 2002
Location: Sol
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
wiz is on a distinguished road
well actually i got it working !!!
using the Jaguar style startup script!!
(/Library/StartupItems/MySQL/MySQL)

here my script...
Code:
#!/bin/sh

##
# MySQL Database Server
##

. /etc/rc.common

StartService ()
{
    if [ "${MYSQL:=-NO-}" = "-YES-" ]; then
	ConsoleMessage "Starting MySQL"
	cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe --user=mysql &
    fi
}

StopService ()
{
    ConsoleMessage "Stopping MySQL"
    /usr/local/mysql/bin/mysqladmin shutdown
}

RestartService ()
{
    if [ "${MYSQL:=-NO-}" = "-YES-" ]; then
	ConsoleMessage "Restarting MySQL"
	StopService
	StartService
    else
	StopService
    fi
}

RunService "$1"
this is cool actually since u can manually start/stop/restart the service by just typing this at command line
Code:
sudo /Library/StartupItems/MySQL/MySQL start
sudo /Library/StartupItems/MySQL/MySQL restart
sudo /Library/StartupItems/MySQL/MySQL stop

Last edited by wiz; January 3rd, 2003 at 04:11 PM.
Reply With Quote
  #5  
Old January 3rd, 2003, 04:01 PM
wiz wiz is offline
Registered User
 
Join Date: Jul 2002
Location: Sol
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
wiz is on a distinguished road
but tryin the system starter i get the following error:
Unable to load localization strings for

i guess thats because i don't have that English.lproj file
Reply With Quote
  #6  
Old January 3rd, 2003, 04:03 PM
wiz wiz is offline
Registered User
 
Join Date: Jul 2002
Location: Sol
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
wiz is on a distinguished road
here is my StartupParameter.plist contents tooo, Jaguar style... (XML actually)
(/Library/StartupItems/MySQL/StartupParameter.plist)

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>MySQL Database Server</string>
	<key>OrderPreference</key>
	<string>Late</string>
	<key>Provides</key>
	<array>
		<string>MySQL</string>
	</array>
	<key>Requires</key>
	<array>
		<string>Network</string>
	</array>
</dict>
</plist>
Reply With Quote
  #7  
Old January 11th, 2003, 04:38 PM
Registered User
 
Join Date: Jan 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
roguephp is on a distinguished road
so wiz,

to get your startup XML script to work, I create a directory inside System/Library/StartupItems called mySQL and put your script in there with the correct path to my mySQL directory?

Thanks
Reply With Quote
  #8  
Old January 12th, 2003, 12:25 AM
wiz wiz is offline
Registered User
 
Join Date: Jul 2002
Location: Sol
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
wiz is on a distinguished road
ditto

but the script might not work with MySQL 3.x
to get it working...

just replace the
Code:
StartService ()
{
    if [ "${MYSQL:=-NO-}" = "-YES-" ]; then
        ConsoleMessage "Starting MySQL"
        cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe --user=mysql &
    fi
}
with
Code:
StartService ()
{
    if [ "${MYSQL:=-NO-}" = "-YES-" ]; then
        ConsoleMessage "Starting MySQL"
        cd /usr/local/mysql ; /usr/local/mysql/bin/safe_mysqld --user=mysql &
    fi
}
notice it's changed from mysqld_safe (4.x) to safe_mysqld for (3.x).

NOTE: some newer binary releases of 4.x have a link name safe_mysqld that links to mysqld_safe

also don't forget to add the MYSQL=-YES- in the /etc/hostconfig
replacing it with MYSQL=-NO- will stop initializing the mysql server on startup

TIP: backup that hostconfig file, it's safer

Last edited by wiz; January 12th, 2003 at 12:50 AM.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SHUTDOWN without warning SCARY!! astro_sk Mac OS X System & Mac Software 10 May 16th, 2003 02:45 PM
Mac G4 won't finish startup after 10.2.3 update akerychuk Mac OS X System & Mac Software 14 February 19th, 2003 10:37 PM
problem with classic startup in jaguar RyanLang Mac Classic System & Software 3 January 14th, 2003 01:05 PM
hack to modify startup sound in jaguar? dtmdoc Mac OS X System & Mac Software 7 November 29th, 2002 03:06 PM
How do I startup and shutdown network services from terminal? vikingshelmut Mac OS X System & Mac Software 7 June 27th, 2002 01:41 PM


All times are GMT -5. The time now is 11:21 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.