Bug 184592 - [PATCH] www/rubygem-unicorn: add rc.d script
Summary: [PATCH] www/rubygem-unicorn: add rc.d script
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
: 194391 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-08 14:20 UTC by geoffroy desvernay
Modified: 2018-01-12 09:29 UTC (History)
3 users (show)

See Also:


Attachments
rubygem-unicorn-4.6.3_1.patch (10.86 KB, patch)
2013-12-08 14:20 UTC, geoffroy desvernay
no flags Details | Diff
rubygem-unicorn-4.6.3.patch (14.93 KB, text/junk)
2014-05-22 21:12 UTC, geoffroy desvernay
no flags Details
rubygem-unicorn-4.6.3.patch (14.93 KB, text/junk)
2014-05-22 21:06 UTC, geoffroy desvernay
no flags Details
Correct patch (not uuencoded, with real corrections) (11.00 KB, patch)
2014-10-15 21:38 UTC, geoffroy desvernay
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description geoffroy desvernay 2013-12-08 14:20:00 UTC
Just add an init script to the port to ease unicorn deployments on freebsd
(stolen from https://github.com/caleb/freebsd-unicorn), original author is cc'd.
tested on 9.2 and 10-BETA4

Port maintainer (ruby@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_11 (mode: change, diff: SVN)

Fix: copy the init script to /usr/local/etc/rc.d or apply this patch to this port :)
How-To-Repeat: figure out how to start unicorn app(s) after installation
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-08 14:20:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ruby

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Steve Wills freebsd_committer freebsd_triage 2014-01-21 04:25:19 UTC
Responsible Changed
From-To: ruby->swills

I'll take it.
Comment 3 Steve Wills freebsd_committer freebsd_triage 2014-02-02 04:05:54 UTC
Hi,

Having a bit of trouble with the rc script. When I run it, I get this:

# service unicorn start
Starting unicorn: .
-E: not found
# 

Perhaps you can take a look and send an updated script?

Thanks,
Steve
Comment 4 Geoffroy Desvernay 2014-03-30 10:15:52 UTC
This is a multi-part message in MIME format.
Comment 5 Regis A. Despres 2014-04-08 11:22:55 UTC
Hi,

Does the set_rcvar has not been deprecated recently ?


 
Regis A. Despres
Comment 6 geoffroy desvernay 2014-05-22 21:06:12 UTC
Description:
without rc_var and with better procname

Responsible committer (ruby@FreeBSD.org; swills@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 1.02 (mode: change, diff: SVN)
Comment 7 geoffroy desvernay 2014-05-22 21:12:37 UTC
Description:
Without rc_setvar and better procname

Responsible committer (ruby@FreeBSD.org; swills@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 1.02 (mode: change, diff: SVN)
Comment 8 geoffroy desvernay 2014-10-15 21:33:52 UTC
*** Bug 194391 has been marked as a duplicate of this bug. ***
Comment 9 geoffroy desvernay 2014-10-15 21:38:09 UTC
Created attachment 148355 [details]
Correct patch (not uuencoded, with real corrections)

Really corrected, well-formatted patch. Sorry for last uuencoded junks...
Comment 10 Steve Wills freebsd_committer freebsd_triage 2014-10-18 16:52:41 UTC
Script looks better, but I still need example on how to use it.

For example, suppose I've run "rails new myapp" in /usr/local/www, so I have myapp in /usr/local/www/myapp. In that dir, I can run "rails s" and it serves my new app. What entries do I need to put in /etc/rc.conf to have unicorn serve this app? I presume I need to create /usr/local/www/myapp/config/unicorn.rb with correct contents? If so, can you verify what should be in it?

Thanks!
Comment 11 geoffroy desvernay 2014-10-24 08:27:11 UTC
Hi, sorry for the delay...

For examples, as I'm not skilled in ruby/rails etc. I think the best exemples are to be found on official docs:
https://devcenter.heroku.com/articles/rails-unicorn
and samples:
https://github.com/heroku/ruby-rails-unicorn-sample/blob/master/config/unicorn.rb

You think such a file sould be added in port ? in pkg-message ?
Comment 12 Steve Wills freebsd_committer freebsd_triage 2014-10-24 12:03:34 UTC
(In reply to geoffroy desvernay from comment #11)
> Hi, sorry for the delay...
> 
> For examples, as I'm not skilled in ruby/rails etc. I think the best
> exemples are to be found on official docs:
> https://devcenter.heroku.com/articles/rails-unicorn
> and samples:
> https://github.com/heroku/ruby-rails-unicorn-sample/blob/master/config/
> unicorn.rb
> 
> You think such a file sould be added in port ? in pkg-message ?

Ok, that helps with the unicorn.rb file, but what about rc.conf?
Comment 13 geoffroy desvernay 2014-10-25 21:27:03 UTC
The most accurate response should be:
https://github.com/caleb/freebsd-unicorn#etcrcconf-details

Again, I'm not a skilled rails/rack/capistrano user, just a simple BSD sysadmin :)

Here for redmine I use happily (:

unicorn_enable="YES"
unicorn_command="/usr/local/bin/unicorn_rails"
unicorn_profiles="redmine"
unicorn_redmine_enable="YES"
unicorn_redmine_rails="YES"
unicorn_redmine_old_pidfile="/usr/local/www/redmine/tmp/pids/unicorn.pid.oldbin"
unicorn_redmine_pidfile="/usr/local/www/redmine/tmp/pids/unicorn.pid"
unicorn_redmine_config="/usr/local/www/redmine/config/unicorn.config.rb"
unicorn_redmine_chdir="/usr/local/www/redmine"
unicorn_redmine_user="redmine"
unicorn_redmine_env="production"

It seems that the rc script is more capistrano-layout oriented (then two lines are sufficient), and it may be simpler, but I'm not enought ruby-skilled to to it myself…
Comment 14 Walter Schwarzenfeld freebsd_triage 2018-01-11 18:19:16 UTC
Is this still relevant?
Comment 15 geoffroy desvernay 2018-01-12 09:29:29 UTC
I'll close this, not very important and the solution is far from perfect…
Thanks !