Greg,

Almost certainly the NGinx stuff is of your inheritance, there's nothing in
the default deploy that assumes to know how to restart your web servers,
only the application servers.

- Lee

On 5 August 2010 22:00, Greg Pederson <[email protected]> wrote:

> Thank you Lee, your information helped me get past that usermod not found
> problem.  Another quick question though...hope you don't mind :)
>
> It seems that cap deploy:setup is trying to run nginx stuff, however this
> server is apache and nginx isn't installed.  Is the apache vs nginx vs both
> set by default or manageable?  This is probably an easy fix but I can't seem
> to find any info.
>
> Thank you again,
> Greg
>
> On Thu, Aug 5, 2010 at 2:59 AM, Lee Hambley <[email protected]> wrote:
>
>> Hi Greg,
>>
>> By design Capistrano will ignore a user's login files (~/.profile,
>> ~/.bash_login, /etc/profile, and the rest (system dependent). You should
>> always endeavour to set the full path to executables.
>>
>> An example might be:
>>
>> set :usermod, '/usr/sbin/usermod'
>>
>> This way you'll also need to modify the task in question (which is an
>> extension in your app, as it's not a standard part of the deploy) to
>> something like run("#{usermod} --gid") (so, variable interpolation)
>>
>> The alternative, if you don't wish to do that is to use the
>> :default_environment (magic undocumented) variable, there's a short and
>> sweet guide here on RVM's site about how it is used, but you can use that to
>> set the environmental variables.
>>
>> This second method might be a short-term solution, but will pollute the
>> logs and output with this stuff before every command that is run(). Here's
>> an example:
>>
>> set :default_environment, {
>>   'PATH' => "/usr/local/bin:/usr/sbin:$PATH",
>>
>>
>> I hope this helps Greg!
>>
>> - Lee H
>>
>> On 5 August 2010 04:15, Greg Pederson <[email protected]> wrote:
>>
>>> Hi All,
>>> I wonder if someone may be able to point me in the right direction
>>> with an issue I'm having.
>>>
>>> I inherited an app and the staging was pointed to the previous dev's
>>> server.  So I updated the deploy/staging.rb file and ran
>>> cap staging deploy:setup
>>>
>>> but failed with
>>>  * executing "sudo -p 'sudo password: ' usermod --gid
>>> app_scan_staging --home /var/www/scan_staging app_scan_staging"
>>>    servers: ["scandesign.com"]
>>>    [scandesign.com] executing command
>>>  ** [out :: scandesign.com] sudo: usermod: command not found
>>>    command finished
>>> failed: "sh -c 'sudo -p '\\''sudo password: '\\'' usermod --gid
>>> app_scan_staging --home /var/www/scan_staging app_scan_staging'" on
>>> scandesign.com
>>>
>>> I went into my server as the user that's set in the deploy.rb which is
>>> set :user, "scandesignwebsite"
>>>
>>> and saw that usermod wasn't found.  So I added /usr/sbin to that
>>> user's path
>>> [scandesignwebs...@app01 ~]$ echo $PATH
>>> /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/scandesignwebsite/
>>> bin:/usr/sbin
>>>
>>> I then ran the failing command manually with no problem
>>> [scandesignwebs...@app01 ~]$  sudo usermod --gid app_scan_staging --
>>> home /var/www/scan_staging app_scan_staging
>>> Password:
>>> [scandesignwebs...@app01 ~]$
>>>
>>>
>>> However, when I try to run cap staging deploy:setup again it still
>>> fails because of usermod
>>>
>>> And here are the versions I'm running at the moment
>>> greg-pedersons-computer-2:scandesign gspederson$ cap --version
>>> Capistrano v2.5.18
>>> greg-pedersons-computer-2:scandesign gspederson$ ruby --version
>>> ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-darwin9]
>>>
>>> Thanks in advance for your help.
>>> Greg
>>>
>>> --
>>> * You received this message because you are subscribed to the Google
>>> Groups "Capistrano" group.
>>> * To post to this group, send email to [email protected]
>>> * To unsubscribe from this group, send email to
>>> [email protected]<capistrano%[email protected]>For
>>>  more options, visit this group at
>>> http://groups.google.com/group/capistrano?hl=en
>>
>>
>>  --
>> * You received this message because you are subscribed to the Google
>> Groups "Capistrano" group.
>> * To post to this group, send email to [email protected]
>> * To unsubscribe from this group, send email to
>> [email protected]<capistrano%[email protected]>For
>>  more options, visit this group at
>> http://groups.google.com/group/capistrano?hl=en
>>
>
>  --
> * You received this message because you are subscribed to the Google Groups
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to
> [email protected]<capistrano%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/capistrano?hl=en
>

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to