Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jimpick/140235 to your computer and use it in GitHub Desktop.
Save jimpick/140235 to your computer and use it in GitHub Desktop.
Here's an example of how I was able to use the rsp from Smart.app to run on a different
port at the same time. It would be nice if this ability was built into the GUI app, but
for now, I hacked it.
I made a directory for my app here:
/Users/jim/joyent/rsp/local-smartasks
I put the application source in a subdirectory called '127.0.0.1'. So the bootstrap.js is
at /Users/jim/joyent/rsp/local-smartasks/127.0.0.1/js/bootstrap.js
I also made a 'data' subdirectory for the runtime data.
There are two more files shown below, so the directory looks like this:
jim-picks-macbook-air-2:~/joyent/rsp/local-smartasks$ ls -al
total 16
drwxr-xr-x 6 jim staff 204 3 Jul 10:15 .
drwxr-xr-x 17 jim staff 578 1 Jul 16:30 ..
-rw-r--r-- 1 jim staff 1005 1 Jul 17:32 .rsp.conf
drwxr-xr-x 6 jim staff 204 1 Jul 16:30 127.0.0.1
drwxr-xr-x 3 jim staff 102 1 Jul 17:31 data
-rwxr-xr-x 1 jim staff 88 1 Jul 17:03 run-smart.sh
The run-smart.sh script:
--- cut here ---
#! /bin/sh
HOME=`pwd` /Applications/Smart.app/Contents/Resources/Image/bin/rspd `pwd`
--- cut here ---
The .rsp.conf file, with modified paths and port number:
--- cut here ---
root=/Applications/Smart.app/Contents/Resources/Image
extensions=Console,DataStore,FileSystem,HTTP,Image,Import,JSONEncoder,OpenId,Sprintf,UUID,Digest,MediaStore
[rsp]
hostroot=/Users/jim/joyent/rsp/local-smartasks
oplimit=100000
storage=storage:local
memcached=127.0.0.1:11211
[mojo]
hostmapper=hostname
port=8081
[host:127.0.0.1]
noconsumption=true
[host:localhost]
alternate=127.0.0.1
[localstorage]
#data=data
#data=data2
data=/Users/jim/joyent/rsp/local-smartasks/data
## The following are storage configurations.
## They both configure storage extensions, where the cluster implementation is different from
## local configuration. It makes the extension list a little more straightforward. One of
## these is referenced by the "storage" configuration option in the rsp group.
[storage:local]
DataStore=SQLite
MediaStore=Local
[storage:localdb]
DataStore=SQLite
MediaStore=MogileFS
[storage:clusterdb]
DataStore=MySQL
MediaStore=Local
[storage:cluster]
DataStore=MySQL
MediaStore=MogileFS
--- cut here ---
Just do './run-smart.sh' to run, and Ctrl-C to kill.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment