Welcome Guest Login Register Member List
ExpressionEngine Forums
Advanced Search
Username: Password:
Remember Me? forgot password?
You are here: Forum Home  >  Installation  >  Mac OS X  >  Thread
   
 
Launch Daemon instructions for os x leopard
 
johnnyfm
Posted: 24 April 2009 01:38 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  12
Joined  2009-04-23

Hi,

I have the instructions for the writing a script so that tracks lauches after a reboot, however, I am new to shell scripts and do not know what to write in for my current installation path.  My confusion is over how to write that part and whether the stack is ruby.bin or mysqld.bin

I installed Tracks 1.7 from the bitnami installer using the default settings on an intell imac

I would really like to do this so that when I do apple updates that require restarts or I fix permissions that Tracks will restart with the reboot.  I’ve attached the instructions I was directed to by the Tracks administrator.

Any direction would be most appreciated.

Image Attachments  Picture 1.png
Click thumbnail to see full-size image
Profile
 
bsag
Posted: 24 April 2009 07:26 AM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

OK, your installation path is the path I gave you in my previous advice (e.g. /Applications/tracks-1.7rc2-1/ctlscript.sh). If you are new to shell scripts, and if you just want to run Tracks under one user account in Mac OS X, I would actually place this file in your ~/Library/LaunchAgents folder. This does the same thing, but means that you don’t need to have admin privileges to write to the file there. So, assuming that your Mac OS X username is johnnyfm, the file you would create in a plain text editor would be:

/Users/johnnyfm/Library/LaunchAgents/com.bitnami-tracks.service.plist 
<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE plist PUBLIC ”-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0”>
<
dict>
  <
key>Label</key> 
  <
string>com.bitnami-tracks.services</string>
  <
key>ProgramArguments</key>
  <array>
   <
string>/Applications/tracks-1.7rc2-1/ctlscript.sh</string>
   <
string>start</string>
  </array>
  <
key>UserName</key>
  <
string>johnnyfm</string>
  <
key>RunAtLoad</key>
  <
true/>
  <
key>OnDemand</key>
  <
false/>
</
dict>
</
plist> 

I haven’t tested that out, and I think that the Username/johnnyfm key/string pair probably isn’t required, but I think it will work. It should start tracks each time you reboot your machine and log in to your user account. If another user on your computer also wanted to do the same thing, you could put the same file (with their username in obviously) into their ~/Library/LaunchAgents folder.

Stop Tracks running using the ctlscript.sh script as I described in the other thread, then try using the service to start it again:

launchctl load -w /Users/johnnyfm/Library/LaunchAgents/com.bitnami-tracks.service.plist 

Then try logging out of your user account and logging back in again (or rebooting the computer if you prefer) to check that it still works. If so, you should be properly set up.

Profile
 
johnnyfm
Posted: 24 April 2009 04:54 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  12
Joined  2009-04-23

Hi

I tried to make the script work by copying and pasting from your last post into both text wrangler and text edit (at separate times) but to no avail.

As the administrator I also tried installing in in both the LaunchAgents file and the LaunchDaemons file and followed the directions, but again I could not get it to launch.

For now I am satisfied with just using the terminal command to launch tracks if I need to restart or shut down my computer.

However, if perhaps there is a solution like taking the usern/johnnyfm key/string pair out I’ll give that a try as well.

Thanks once again for your prompt and helpful response.

Sincerely,

John

Profile
 
bsag
Posted: 24 April 2009 05:01 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

Hmm, did you get an error of any kind when you ran the launchctl load command? I don’t have Bitnami installed on this computer, but if you give me couple of days, I’ll try it out and see what’s going wrong.

Profile
 
johnnyfm
Posted: 24 April 2009 05:53 PM   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  12
Joined  2009-04-23

Thanks, after I put the script into the LaunchDaemons or in the LaunchAgents file when I looked inside to see if everything was copied the same - it wasn’t always the same, but on the last attempt it was copied as written into LaunchDaemons and still failed to work.

Would it have anything to do with my adminstrator names?

For my computer my administrator name is simply administrator.

However, when I first installed bitnami-tracks 1.6 and it asked for an administrator name I put down administrator and then filled out user name as John Croutch.

When I shut down and could no longer load bitnami-tracks I asked for your advice and you told me to install tracks 1.7 which I did, however, this time I put for administrator name johnnyfm and for user name John Croutch, I then created a user account with the name johncroutch.

So as of now I have a clean and empty administrator (johnnyfm) account, incase I want to add new users, and I have my user account: johncroutch both with separate passwords.

I don’t know if this information is relevant, but I hope it helps.

Thanks again,

John

Profile
 
bsag
Posted: 26 April 2009 02:08 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

OK, I’ve tried it out, and I think I’ve sorted it out, but I can’t be absolutely sure. I also tried ~/Library/LaunchAgents and found that didn’t work, but I think that one problem was that I’d used ‘services’ on the end of the label for the *.plist file in the file, but the file itself was ‘service’. So I fixed that, added the Username/root pair (which does seem to be necessary) and put it in to /Library/LaunchDaemons. That folder is owned by root, so you’ll have to give your administrator password to save the file there.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<
plist version="1.0">
<
dict>
    <
key>Disabled</key>
    <
true/>
    <
key>Label</key>
    <
string>com.bitnami-tracks.service</string>
    <
key>OnDemand</key>
    <
false/>
    <
key>ProgramArguments</key>
    <array>
        <
string>/Applications/tracks-1.7rc2-1/ctlscript.sh</string>
        <
string>start</string>
    </array>
    <
key>RunAtLoad</key>
    <
true/>
    <
key>UserName</key>
    <
string>root</string>
</
dict>
</
plist> 


The problem I ran in to is that I’ve already got MySQL running on my computer, and the script seemed to run into difficulties because of that. Also, it takes quite a long time to start all the services if you use the launchctl command, so you can use Console (in your /Applications/Utilities folder) and read the console or system log to see the messages as the services are started, and debug any problems (that was how I found out that MySQL was causing difficulties in my case). Another issue is that - with the .plist file in /Library/LaunchDaemons - you need to use the sudo command to run it, i.e.:

sudo launchctl load -w /Library/LaunchDaemons/com.bitnami-tracks.service.plist 

Another thing to check is that the name for your Bitnami installation is correct in the .plist file. Note that with the /Library/LaunchDaemons location, the service will only be started at boot time, not on login.

So, have a go with the version I’ve pasted, and let me know how it goes. If it works, I’ll post the instructions on the wiki, and if not, I think you’ll have to stick with the manual method!

Profile
 
johnnyfm
Posted: 26 April 2009 04:16 PM   [ Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  12
Joined  2009-04-23

Hi, I did as instructed, however, I’m not sure if the sudo command ran as it asked for my password and it didn’t appear as if it was entering my password, but rather than do anything else I thought I would try it.

So I rebooted and tried to enter Tracks and I got the error messay:

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

I will wait and see, but is this really something on your end or did the sudo command not run.

Thanks,

John

Profile
 
bsag
Posted: 26 April 2009 04:33 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  217
Joined  2006-03-05

It’s normal for the sudo command not to show the characters as you’d typed them. If you’d got the password wrong, it would have given an error message. But clearly it hasn’t started all of the services up properly. It sounds as if Apache is running by not MySQL. Did you try opening Console and watching the messages?

I’m pretty sure that the LaunchDaemon script is correct (it’s also the same as the script that Bitnami published, and the instructions are the same), so I’m not sure what’s going on. Perhaps you could contact Bitnami and ask them what the problem might be?

Profile
 
johnnyfm
Posted: 26 April 2009 04:43 PM   [ Ignore ]   [ # 8 ]  
Newbie
Rank
Total Posts:  12
Joined  2009-04-23

I just rebooted again and tried the sudo command and it says track already loaded, but when I try to enter tracks I still get this message.

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

However, when I use this terminal command I can get back into tracks

cd /Applications/tracks-1.7rc2-1/ 

./ctlscript.sh start

I haven’t tried reading the console yet to see if I can figure out where the problem is yet as I am not sure what I should be looking for, but I will give it a try.

Thanks for your help,

But as you say if I have to use the terminal command each time I shut down, it is not too big of a price for such a good application.

Yes, I will contact bitnami and see if they can straighten it out

Thanks

Profile
 
fireferum
Posted: 03 June 2009 10:32 PM   [ Ignore ]   [ # 9 ]  
Newbie
Rank
Total Posts:  2
Joined  2009-06-03

Where would I find this script on a linux box? In my case on a CentOS box? I am having the same problem.

Profile
 
   
 
 
‹‹ Failed to Connect Firefox can’t establish a connection to the server at 127.0.0.1:8080      Tracks won’t start using teminal command ››

Powered By ExpressionEngine
Template Design By Sonnenvogel.com
Select a theme:

ExpressionEngine Discussion Forum - Version 2.1.2 (20091002)
Script Executed in 0.1315 seconds

Atom Feed
RSS 2.0