# Nginx and mongrel, more info

**URL:** <https://www.ruby-forum.com/t/nginx-and-mongrel-more-info/158525>\
**Category:** Rails\
**Created:** [January 24, 2009, 10:39am UTC](https://www.ruby-forum.com/t/nginx-and-mongrel-more-info/158525 "2009-01-24T10:39:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [January 24, 2009, 10:39am UTC](https://www.ruby-forum.com/t/nginx-and-mongrel-more-info/158525/1 "2009-01-24T10:39:35Z")

</div>

Hello,

Where I can find more info on how to nginx and mongrel boot when the  
machine reboots ?

In os x, please. In Linux world I found some scripts but they don’t work  
and don’t go in the same place as OS X.

thanks,

r.

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [January 24, 2009, 11:07pm UTC](https://www.ruby-forum.com/t/nginx-and-mongrel-more-info/158525/2 "2009-01-24T23:07:50Z")

</div>

Check out the directory /Library/StartupItems/ in which you’ll find  
directories for user added systems that need to be started at  
boottime. Typically, there will be a directory for your printer  
(assuming you have one attached) as well as a directory for mysql and/  
or postgresql.

The start/stop script and plist live there - naming convention seems  
to be:  
scriptname == /Library/StartupItems/DirectoryName  
plistname == StartupParameters.plist

Here’s a script and plist for mysql as an example.

MySQLCOM:

* * *

#!/bin/sh

# 

# /Library/StartupItems/MySQLCOM/MySQLCOM

# 

# A script to automatically start up MySQL on system bootup

# for Mac OS X. This is actually just a wrapper script around

# the standard mysql.server init script, which is included in

# the binary distribution.

# 

# (c) 2003 MySQL AB

# Written by Lenz G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

# 

# Suppress the annoying “$1: unbound variable” error when no option

# was given

if [-z $1] ; then  
echo "Usage: $0 [start|stop|restart] "  
exit 1  
fi

# Source the common setup functions for startup scripts

test -r /etc/rc.common || exit 1  
. /etc/rc.common

# The path to the mysql.server init script. The official MySQL

# Mac OS X packages are being installed into /usr/local/mysql.

SCRIPT=“/usr/local/mysql/support-files/mysql.server”

StartService ()  
{  
if [“${MYSQLCOM:=-NO-}” = “-YES-”] ; then  
ConsoleMessage “Starting MySQL database server”  
$SCRIPT start \> /dev/null 2\>&1  
fi  
}

StopService ()  
{  
ConsoleMessage “Stopping MySQL database server”  
$SCRIPT stop \> /dev/null 2\>&1  
}

RestartService ()  
{  
ConsoleMessage “Restarting MySQL database server”  
$SCRIPT restart \> /dev/null 2\>&1  
}

if test -x $SCRIPT ; then  
RunService “$1”  
else  
ConsoleMessage “Could not find MySQL startup script!”  
fi

* * *

StartupParameters.plist:

* * *
\<?xml version="1.0" encoding="UTF-8"?\> Description MySQL 5.0.51a-community OrderPreference None Provides MySQL Uses Network Resolver 
* * *

Rick

Rick

On Jan 23, 11:39 pm, Raimon Fs [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![raimon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@raimon](https://www.ruby-forum.com/u/raimon)\
**Post date:** [January 26, 2009, 8:46am UTC](https://www.ruby-forum.com/t/nginx-and-mongrel-more-info/158525/3 "2009-01-26T08:46:44Z")

</div>

Hi Rick,

I know this place, what I’m not sure if I had really to start-up mongrel  
executing the spin file that’s inside the scripts folder.

That file is created by Capistrano when doing a deploy, and Capistano  
can execute it, but I’m total newbiew here when it’s a restart or after  
a shut-down …

thanks,

rai
