{"id":166807,"date":"2013-01-23T15:15:03","date_gmt":"2013-01-23T11:15:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=166807"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=166807","title":{"rendered":"<span class=\"post_title\">\u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a rails+rvm+unicorn+nginx \u043d\u0430 FreeBSD<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u00ab\u0441\u043f\u0430\u0441\u0438\u0431\u043e\u00bb \u0430\u0432\u0442\u043e\u0440\u0443 <a href=\"http:\/\/habrahabr.ru\/post\/120368\/\">\u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430<\/a>. \u0411\u0435\u0437 \u043d\u0435\u0433\u043e \u044f \u0431\u044b \u0434\u043e\u043b\u0433\u043e \u0435\u0449\u0451 \u043d\u0435 \u0441\u0435\u043b \u0437\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430: \u043a\u0443\u0447\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0435\u0448\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0447\u0443\u0442\u044c \u0434\u0440\u0443\u0433\u0430\u044f (\u043d\u0435 Debian, \u0430 FreeBSD), \u0434\u0430 \u0438 \u0432\u043e\u043f\u0440\u043e\u0441 \u0441 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c unicorn \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c. \u0412\u0441\u0442\u0440\u0435\u0447\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043c\u043d\u0435 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0437\u044f\u0449\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u043e\u0432\u0430\u043b\u0438: \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e \u0441\u043b\u0443\u0436\u0431\u0435 \u043d\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u043c\u043e\u0432\u0435\u0442\u043e\u043d. \u0412\u043e FreeBSD \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u00ab\u043c\u0435\u0442\u0430\u0441\u043b\u0443\u0436\u0431\u00bb, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u2014 FreeBSD jails). \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b\u2026<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>rc.d<\/h5>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 rc.d-\u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0430\u0439\u043b\u043e\u043c <code>\/etc\/rc.conf<\/code> \u0438 \u0435\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u043e\u043c <code>\/etc\/rc.conf.local<\/code>, \u0430 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 <code>\/etc\/rc.conf.d<\/code> \u0438 <code>\/usr\/local\/etc\/rc.conf.d<\/code>. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f \u2014 \u0444\u0430\u0439\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0438\u0445 \u0441\u043b\u0443\u0436\u0431\u044b. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043d\u0435\u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u043d\u0441\u0442\u0440\u043e\u0432 \u0438\u0437 \u0441\u043e\u0442\u043d\u0438 \u0441 \u043b\u0438\u0448\u043d\u0438\u043c \u0441\u0442\u0440\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0435\u0437 grep&#8217;\u0430 \u043d\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u0448\u044c\u0441\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c: \u0435\u0441\u043b\u0438 \u0443 \u0441\u043b\u0443\u0436\u0431\u044b \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432, \u0412\u0421\u0415 \u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (\u0438\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e, \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u044b). \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043b\u0443\u0436\u0431.<br \/>  \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: &quot; \u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442 <code>\/etc\/rc<\/code>. \u041e\u043d \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <code>\/etc\/rc.conf<\/code> (\u0430 \u0442\u0430\u043a\u0436\u0435 <code>\/etc\/rc.conf.local<\/code> \u2014 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0433\u043e)&#8230;&quot; \u0410 \u0432\u043e\u0442 \u0438 \u043d\u0435\u0442! \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d <b>\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442<\/b> \u0432 \u0441\u0435\u0431\u044f \u0444\u0430\u0439\u043b <code>\/etc\/rc.subr<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u0435-\u043a\u0430\u043a\u0438\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 <b>\u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439<\/b> \u0432 \u0441\u0435\u0431\u044f \u0444\u0430\u0439\u043b\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a:  <\/p>\n<pre><code class=\"bash\">... if ${_rc_conf_loaded:-false}; then         : else         if [ -r \/etc\/defaults\/rc.conf ]; then                 debug &quot;Sourcing \/etc\/defaults\/rc.conf&quot;                 . \/etc\/defaults\/rc.conf                 source_rc_confs         elif [ -r \/etc\/rc.conf ]; then                 debug &quot;Sourcing \/etc\/rc.conf (\/etc\/defaults\/rc.conf doesn't exist).&quot;                 . \/etc\/rc.conf         fi         _rc_conf_loaded=true fi if [ -f \/etc\/rc.conf.d\/&quot;$_name&quot; ]; then         debug &quot;Sourcing \/etc\/rc.conf.d\/${_name}&quot;         . \/etc\/rc.conf.d\/&quot;$_name&quot; fi ... <\/code><\/pre>\n<p>  \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0444\u0430\u0439\u043b <code>\/etc\/defaults\/rc.conf<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"bash\">... rc_conf_files=&quot;\/etc\/rc.conf \/etc\/rc.conf.local&quot; ... ############################################################## ### Define source_rc_confs, the mechanism used by \/etc\/rc.* ## ### scripts to source rc_conf_files overrides safely.       ## ##############################################################  if [ -z &quot;${source_rc_confs_defined}&quot; ]; then         source_rc_confs_defined=yes         source_rc_confs () {                 local i sourced_files                 for i in ${rc_conf_files}; do                         case ${sourced_files} in                         *:$i:*)                                 ;;                         *)                                 sourced_files=&quot;${sourced_files}:$i:&quot;                                 if [ -r $i ]; then                                         . $i                                 fi                                 ;;                         esac                 done         } fi <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u0441\u0435\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431, \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u2014 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043e\u043d\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 <b>\u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u043b\u0443\u0436\u0431 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>\/etc\/rc.d<\/code><\/b> \u2014 \u044d\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0414\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u043b\u0443\u0436\u0431 \u0435\u0441\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>\/usr\/local\/etc\/rc.d<\/code> \u2014 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043d\u0451\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043a\u043e\u0433\u0434\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u0436\u0435 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435. \u041d\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0447\u0451\u0440\u043d\u0430\u044f \u043c\u0430\u0433\u0438\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435: \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441\u043d\u043e\u0432\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 <code>\/etc\/rc.subr<\/code>, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0449\u0438\u0439 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0418 \u0432\u043e\u0442 \u044d\u0442\u043e-\u0442\u043e \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a: \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>\/etc\/rc.conf.d<\/code> \u043a\u043e\u0434 \u0432\u0440\u043e\u0434\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e (\u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 unicorn):  <\/p>\n<pre><code class=\"bash\">unicorn_enable=&quot;YES&quot; unicorn_profiles=&quot;&quot;  for p in $(grep -rlE '^unicorn_[0-9a-zA-Z]+_enabled=&quot;[Yy][Ee][Ss]&quot;$' \/usr\/local\/etc\/unicorn.d); do \tbn=$(basename $p) \tif [ -n &quot;$unicorn_profiles&quot; ]; then \t\tunicorn_profiles=&quot;$unicorn_profiles $bn&quot; \telse \t\tunicorn_profiles=&quot;$bn&quot; \tfi \t. $p done <\/code><\/pre>\n<h5>Unicorn<\/h5>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c <code>sudo<\/code> \u2014 \u044d\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u0447\u0435\u043c \u00ab\u043b\u0435\u043f\u0438\u0442\u044c\u00bb \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 su, \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044f\u0441\u044c \u043d\u0430 shell injection.  <\/p>\n<pre><code class=\"bash\">cd \/usr\/ports\/security\/sudo && make install clean <\/code><\/pre>\n<p>  \u0415\u0449\u0451 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c portmaster \u2014 \u044d\u0442\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441:  <\/p>\n<pre><code class=\"bash\">cd \/usr\/ports\/ports-mgmt\/portmaster && make install clean <\/code><\/pre>\n<p>  \u0412\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0444\u0442 \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441 \u0435\u0451 \u043f\u043e\u043c\u043e\u0449\u044c\u044e:  <\/p>\n<pre><code class=\"bash\">LN='ln -f' portmaster devel\/bison textproc\/libxml2 textproc\/libxslt textproc\/diffutils devel\/gmake security\/openssl devel\/automake devel\/git devel\/subversion shells\/bash <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043b\u0435\u043d\u0438\u0432\u044b\u0445 \u2014 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:  <\/p>\n<pre><code class=\"bash\">portmaster lang\/ruby19 sysutils\/rubygem-bundler www\/rubygem-unicorn <\/code><\/pre>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0448\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u2014 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0440\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0436\u0431\u044b.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u0441\u043b\u0443\u0436\u0431\u044b, \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"bash\">is_unicorn_profile() {     local profile      for profile in $unicorn_profiles; do         if [ &quot;$profile&quot; = &quot;$1&quot; ]; then             return 0         fi     done      return 1 }  if [ -n &quot;${unicorn_profiles}&quot; ]; then         if [ -n &quot;$2&quot; ]; then                 profile=&quot;$2&quot;                 if ! is_unicorn_profile $profile; then                         echo &quot;$0: no such profile defined in unicorn_profiles.&quot;                     exit 1                 fi                 eval unicorn_socket=\\${unicorn_${profile}_socket:-&quot;\/tmp\/${name}-${profile}.sock&quot;}                 eval unicorn_config=\\${unicorn_${profile}_config}                 eval unicorn_dir=\\${unicorn_${profile}_dir}                 eval unicorn_flags=\\${unicorn_${profile}_flags:-&quot;${unicorn_flags}&quot;}                 eval unicorn_environment=\\${unicorn_${profile}_environment:-&quot;${unicorn_environment}&quot;}                 eval unicorn_rails=\\${unicorn_${profile}_rails:-&quot;${unicorn_rails}&quot;}                 eval unicorn_user=\\${unicorn_${profile}_user:-&quot;${unicorn_user}&quot;}                 eval unicorn_procname=\\${unicorn_${profile}_procname:-&quot;${unicorn_procname}&quot;}                 eval unicorn_bundler=\\${unicorn_${profile}_bundler:-&quot;${unicorn_bundler}&quot;}                 eval unicorn_rvm=\\${unicorn_${profile}_rvm:-&quot;${unicorn_rvm}&quot;}                 eval unicorn_ruby=\\${unicorn_${profile}_ruby:-&quot;${unicorn_ruby}&quot;}                 if checkyesno unicorn_rvm; then                         unicorn_procname=&quot;~${unicorn_user}\/.rvm\/rubies\/ruby-${unicorn_ruby}\/bin\/ruby&quot;                 fi         elif [ -n &quot;$1&quot; ]; then                 for profile in ${unicorn_profiles}; do                 echo &quot;Processing ${name} profile: ${profile}&quot;                 $0 $1 ${profile}             done             exit 0         fi fi <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 RVM \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443: \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043f\u0435\u0440\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c:  <\/p>\n<pre><code class=\"bash\">if checkyesno unicorn_rvm; then         if [ -d &quot;~${unicorn_user}\/.rvm\/${unicorn_ruby}&quot; ]; then                 \/usr\/local\/bin\/sudo -u $unicorn_user \/usr\/local\/bin\/unicorn-wrapper ${unicorn_ruby} $(basename ${command}) ${command_args}                 rc=$?         else                 echo &quot;Ruby version ${unicorn_ruby} not found by RVM for user ${unicorn_user}&quot;                 rc=1         fi else         \/usr\/local\/bin\/sudo -u $unicorn_user ${command} ${command_args}         rc=$? fi <\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b <a href=\"https:\/\/github.com\/orthanner\/unix-tools\/raw\/master\/unicorn-wrapper\"><code>\/usr\/local\/bin\/unicorn-wrapper<\/code><\/a> \u2014 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043e\u0431\u0451\u0440\u0442\u043a\u0430, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e Ruby \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0430\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041f\u043e\u043b\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/github.com\/orthanner\/unix-tools\/raw\/master\/rc.d\/unicorn\">\u0440\u044f\u0434\u043e\u043c<\/a>. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e:  <\/p>\n<pre><code class=\"bash\">service unicorn &lt;action&gt; [&lt;app&gt;] <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0430:  <\/p>\n<pre><code class=\"bash\">unicorn_redmine_enabled=&quot;YES&quot; unicorn_redmine_dir=&quot;\/var\/www\/sites\/mycoolsite.tld\/redmine&quot; unicorn_redmine_rails=&quot;NO&quot; <\/code><\/pre>\n<p>  \u041f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443, \u043d\u0430\u0434\u043e \u0431\u044b \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c Port Request, \u043d\u043e \u043f\u043e\u043a\u0430 \u0440\u0443\u043a\u0438 \u043d\u0435 \u0434\u043e\u0448\u043b\u0438.<\/p>\n<p>  P. S. \u041e\u0441\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u043e\u0431\u0440\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0442\u0435\u043c \u0436\u0435 capistrano, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u0435 \u0441\u043b\u0435\u0442\u0430\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438? \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/166807\/\"> http:\/\/habrahabr.ru\/post\/166807\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u00ab\u0441\u043f\u0430\u0441\u0438\u0431\u043e\u00bb \u0430\u0432\u0442\u043e\u0440\u0443 <a href=\"http:\/\/habrahabr.ru\/post\/120368\/\">\u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430<\/a>. \u0411\u0435\u0437 \u043d\u0435\u0433\u043e \u044f \u0431\u044b \u0434\u043e\u043b\u0433\u043e \u0435\u0449\u0451 \u043d\u0435 \u0441\u0435\u043b \u0437\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430: \u043a\u0443\u0447\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0435\u0448\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0447\u0443\u0442\u044c \u0434\u0440\u0443\u0433\u0430\u044f (\u043d\u0435 Debian, \u0430 FreeBSD), \u0434\u0430 \u0438 \u0432\u043e\u043f\u0440\u043e\u0441 \u0441 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c unicorn \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c. \u0412\u0441\u0442\u0440\u0435\u0447\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043c\u043d\u0435 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0437\u044f\u0449\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0436\u0435 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u043e\u0432\u0430\u043b\u0438: \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e \u0441\u043b\u0443\u0436\u0431\u0435 \u043d\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u043c\u043e\u0432\u0435\u0442\u043e\u043d. \u0412\u043e FreeBSD \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u00ab\u043c\u0435\u0442\u0430\u0441\u043b\u0443\u0436\u0431\u00bb, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u2014 FreeBSD jails). \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441\u044b\u2026  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-166807","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=166807"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/166807\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=166807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=166807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=166807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}