Giter Site home page Giter Site logo

Comments (4)

imanel avatar imanel commented on May 18, 2024

It's because of "install" command is linux only command, and linux is defined by ruby platform variable. It could be easy implemented for Mac after detection of this system will be pulled from pull request #64

from thin.

imanel avatar imanel commented on May 18, 2024

Responding to (yet) unanswered question - I can implement config file for autostart(it will be simple XML file copied to directory, so nothing fancy;) is @macournoyer will accept Mac-detection patch.

from thin.

ddebernardy avatar ddebernardy commented on May 18, 2024

Well, for the note, I eventually got it to work.

Config file:

DB:~/Sites/rubyapp $ cat config/thin.yml 
--- 
chdir: /Users/denis/Sites/rubyapp
environment: development
address: 0.0.0.0
port: 5000
timeout: 30
log: log/thin/thin.log
pid: tmp/thin/thin.pid
max_conns: 1024
max_persistent_conns: 512
require: []

wait: 30
servers: 1
daemonize: true

shell wrapper:

DB:~/Sites/rubyapp $ cat scripts/thin/thin.sh
#!/bin/sh
#

#
# Init
#
prefix=/opt/local

case $1 in
  start  )  [ -x /opt/local/bin/thin ] && \
            /opt/local/bin/thin start -C /Users/denis/Sites/rubyapp/config/thin.yml #> /dev/null
            ;;
  stop   )  [ -x /opt/local/bin/thin ] && \
            /opt/local/bin/thin stop -C /Users/denis/Sites/rubyapp/config/thin.yml #> /dev/null
            ;;
  restart)  [ -x /opt/local/bin/thin ] && \
            /opt/local/bin/thin restart -C /Users/denis/Sites/rubyapp/config/thin.yml #> /dev/null
            ;;
  *      )  echo "$0: unknown argument: $1";;
esac

plist file:

DB:~/Sites/rubyapp $ cat scripts/thin/thin.plist 
<?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>Label</key><string>local.rubyapp.thin</string>
<key>ProgramArguments</key>
<array>
    <string>/opt/local/bin/daemondo</string>
    <string>--label=rubyapp</string>
    <string>--start-cmd</string>
    <string>/Users/denis/Sites/rubyapp/scripts/thin/thin.sh</string>
    <string>start</string>
    <string>;</string>
    <string>--stop-cmd</string>
    <string>/Users/denis/Sites/rubyapp/scripts/thin/thin.sh</string>
    <string>stop</string>
    <string>;</string>
    <string>--restart-cmd</string>
    <string>/Users/denis/Sites/rubyapp/scripts/thin/thin.sh</string>
    <string>restart</string>
    <string>;</string>
    <string>--pid=none</string>
</array>
<key>Debug</key><false/>
<key>Disabled</key><true/>
<key>OnDemand</key><false/>
</dict>
</plist>

Auto-start:

DB:~/Sites/rubyapp $ sudo ln -s scripts/thin/thin.plist /Library/LaunchDaemons/local.rubyapp.thin.plist
DB:~/Sites/rubyapp $ sudo launchctl -v load -w /Library/LaunchDaemons/local.rubyapp.thin.plist

Hope this helps someone...

from thin.

macournoyer avatar macournoyer commented on May 18, 2024

Indeed, didn't work because this command is linux only for now. If you can make a pull request to implement this, I'll merge for sure :)

from thin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.