Sha256: fb6a21ca6b0134c1770c9c6b630c2762a3e139e63bcfcbdf529aec953a865df5

Contents?: true

Size: 1.67 KB

Versions: 69

Compression:

Stored size: 1.67 KB

Contents

# Puma as a service using rc.d

Manage multiple Puma servers as services on one box using FreeBSD's rc.d service.

## Dependencies

* `jq` - a command-line json parser is needed to parse the json in the config file

## Installation

    # Copy the puma script to the rc.d directory (make sure everyone has read/execute perms)
    sudo cp puma /usr/local/etc/rc.d/

    # Create an empty configuration file
    sudo touch /usr/local/etc/puma.conf

    # Enable the puma service
    sudo echo 'puma_enable="YES"' >> /etc/rc.conf

## Managing the jungle

Puma apps are referenced in /usr/local/etc/puma.conf by default.

Start the jungle running:

`service puma start`

This script will run at boot time.


You can also stop the jungle (stops ALL puma instances) by running:

`service puma stop`


To restart the jungle:

`service puma restart`

## Conventions

* The script expects:
  * a config file to exist under `config/puma.rb` in your app. E.g.: `/home/apps/my-app/config/puma.rb`.

You can always change those defaults by editing the scripts.

## Here's what a minimal app's config file should have

```
{
	"servers" : [
		{
			"dir": "/path/to/rails/project",
			"user": "deploy-user",
			"ruby_version": "ruby.version",
			"ruby_env": "rbenv"
		}
	]
}
```

## Before starting...

You need to customise `puma.conf` to:

* Set the right user your app should be running on unless you want root to execute it!
* Set the directory of the app
* Set the ruby version to execute
* Set the ruby environment (currently set to rbenv, since that is the only ruby environment currently supported)
* Add additional server instances following the scheme in the example

## Notes:

Only rbenv is currently supported.

Version data entries

69 entries across 69 versions & 6 rubygems

Version Path
puma-6.5.0-java docs/jungle/rc.d/README.md
puma-6.5.0 docs/jungle/rc.d/README.md
jun-puma-1.0.1-java docs/jungle/rc.d/README.md
jun-puma-1.0.0-java docs/jungle/rc.d/README.md
puma-5.6.9-java docs/jungle/rc.d/README.md
puma-6.4.3-java docs/jungle/rc.d/README.md
puma-6.4.3 docs/jungle/rc.d/README.md
puma-5.6.9 docs/jungle/rc.d/README.md
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/puma-5.6.8/docs/jungle/rc.d/README.md
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/puma-6.4.2/docs/jungle/rc.d/README.md
puma-5.6.8-java docs/jungle/rc.d/README.md
puma-5.6.8 docs/jungle/rc.d/README.md
puma-6.4.2-java docs/jungle/rc.d/README.md
puma-6.4.2 docs/jungle/rc.d/README.md
puma-6.4.1-java docs/jungle/rc.d/README.md
puma-6.4.1 docs/jungle/rc.d/README.md
puma-6.4.0-java docs/jungle/rc.d/README.md
puma-6.4.0 docs/jungle/rc.d/README.md
puma-5.6.7-java docs/jungle/rc.d/README.md
puma-5.6.7 docs/jungle/rc.d/README.md