# Starling Service

**URL:** <https://www.ruby-forum.com/t/starling-service/162783>\
**Category:** Rails\
**Created:** [March 13, 2009, 6:42pm UTC](https://www.ruby-forum.com/t/starling-service/162783 "2009-03-13T18:42:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 13, 2009, 6:42pm UTC](https://www.ruby-forum.com/t/starling-service/162783/1 "2009-03-13T18:42:34Z")

</div>

Does anyone know a graceful way to stop the Starling service? I can’t  
seem to find any documentation and have just been issuing a kill  
command on the pid.

Thanks,  
Tom

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 13, 2009, 8:08pm UTC](https://www.ruby-forum.com/t/starling-service/162783/2 "2009-03-13T20:08:48Z")

</div>

#!/bin/sh

### BEGIN INIT INFO

# Provides: starling

# Required-Start: $local\_fs $remote\_fs

# Required-Stop: $local\_fs $remote\_fs

# Default-Start: 2 3 4 5

# Default-Stop: S 0 1 6

# Short-Description: starling initscript

# Description: starling

### END INIT INFO

# Source function library.

. /etc/rc.d/init.d/functions

DAEMON=starling  
DAEMON\_PATH=/usr/local/bin/  
SCRIPT\_NAME=/etc/init.d/starling  
CONFIG\_PATH=/var/www/site/current/config/production-starling.yml

start()  
{  
echo -n $"Starting $DAEMON: "  
daemon $DAEMON\_PATH$DAEMON start -f $CONFIG\_PATH

```
    touch /var/lock/subsys/$DAEMON
    echo

```

}

stop()  
{  
echo -n $"Shutting down $DAEMON: "  
killproc $DAEMON

```
    rm -f /var/lock/subsys/$DAEMON
    echo

```

}

# Exit if the package is not installed

[-x “$DAEMON\_PATH$DAEMON”] || exit 0

case “$1” in  
start)  
start  
;;  
stop)  
stop  
;;  
restart)  
stop  
start  
;;  
\*)  
echo “Usage: $SCRIPT\_NAME {start|stop|restart}” \>&2  
exit 3  
;;  
esac

:

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 16, 2009, 4:15pm UTC](https://www.ruby-forum.com/t/starling-service/162783/3 "2009-03-16T16:15:18Z")

</div>

Freddy,

I’m not sure this script will work. There is no /etc/init.d/starling  
script?

Thanks,  
Tom
