PDA

View Full Version : How to Make Automatic Running Program?




jauhari
Jan 1, 2008, 11:00 PM
I have installed XAMPP and running with Perfect, but I have little bit question. I want make my XAMPP (Apache and Mysql) Every Time I turn on my Mac OSX Leopard.

How to add this line to my Mac OSX Leopard startup

/Applications/xampp/xamppfiles/mampp startapache
/Applications/xampp/xamppfiles/mampp startmysql

Please Help me



CaptainZap
Jan 1, 2008, 11:03 PM
You could put that into a shell script and then make an Automator Application that runs that shell script, then add it to your login items.

WildPalms
Jan 1, 2008, 11:04 PM
You could put that into a shell script and then make an Automator Application that runs that shell script, then add it to your login items.

...or skip the Automator section and add the shell script directly to your login items.

CaptainZap
Jan 1, 2008, 11:06 PM
...or skip the Automator section and add the shell script directly to your login items.

Really that will work? Awesome, didn't know that.

WildPalms
Jan 1, 2008, 11:08 PM
Really that will work? Awesome, didn't know that.

Yep, just have to navigate to the shell script and ensure it has a suffix of .sh so that Finder knows how to display it.

jauhari
Jan 1, 2008, 11:09 PM
...or skip the Automator section and add the shell script directly to your login items.

Can you give me real example? I am still newbie in Mac OSX Leopard, I just switched in early December and Thanks before

Yep, just have to navigate to the shell script and ensure it has a suffix of .sh so that Finder knows how to display it.

The other problems is, this code must be executed by ROOT. How to do that? so I can hide this startup and running with smoothly.

Please Help me

WildPalms
Jan 1, 2008, 11:17 PM
In Textedit or in Terminal, create a file in your home directory called xampstart.sh and then go into System Preferences, then Accounts and click on Login Items and add the shell script in there.

In Terminal:

1. cd ~
2. touch xampstart.sh
3. echo /Applications/xampp/xamppfiles/mampp startapache >> xampstart.sh
4. echo /Applications/xampp/xamppfiles/mampp startmysql >> xampstart.sh
5. chmod 770 xampstart.sh

Then go into System Preferences, click on Accounts, select your username, then click on Login Items, click on the plus symbol (+) and navigate to your home folder and select the xampstart.sh file.

Just one way ;)

jauhari
Jan 1, 2008, 11:19 PM
In Textedit or in Terminal, create a file in your home directory called xampstart.sh and then go into System Preferences, then Accounts and click on Login Items and add the shell script in there.

In Terminal:

1. cd ~
2. touch xampstart.sh
3. echo /Applications/xampp/xamppfiles/mampp startapache >> xampstart.sh
4. echo /Applications/xampp/xamppfiles/mampp startmysql >> xampstart.sh
5. chmod 770 xampstart.sh

Then go into System Preferences, click on Accounts, select your username, then click on Login Items, click on the plus symbol (+) and navigate to your home folder and select the xampstart.sh file.

Just one way ;)

Perfect, how about my other problem? this code must be executed as ROOT.
Please help

Thanks

jauhari
Jan 2, 2008, 01:59 AM
Anybody can help me to solve this problem?

Mal
Jan 2, 2008, 08:24 AM
Anybody can help me to solve this problem?

Just add sudo to the beginning of each line, or on the line before, "login root" (obviously without the quotes). Of course, either way, you'll have to type your password, no way of getting around that AFAIK (and that's probably a good thing).

jW