Strange permission issue with nohup

4,705 views
Skip to first unread message

Thijs van der Vossen

unread,
Mar 31, 2008, 5:37:04 PM3/31/08
to Capistrano
Here I'm trying to run the command from the cap deploy:start task:

[thijs@miller www]$ sudo -p 'sudo password: ' -u app sh -c 'cd /var/
www/boommanager/current && nohup script/spin'
nohup: failed to open `nohup.out': Permission denied
nohup: failed to open `/home/thijs/nohup.out': Permission denied

Anyone a suggestion why nohup is trying to write to /home/thijs/
nohup.out?

Jamis Buck

unread,
Mar 31, 2008, 5:41:24 PM3/31/08
to capis...@googlegroups.com
From "man nohup":

If the output file nohup.out cannot be created in the current
directory, the nohup utility uses the directory named by HOME
to create the file.

My guess is that since "sh -c" doesn't start a login shell, it is
inheriting the environment of the invoking shell, including the HOME
environment variable, and is trying to open it there.

- Jamis

> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>

Thijs van der Vossen

unread,
Mar 31, 2008, 5:46:15 PM3/31/08
to capis...@googlegroups.com
On 31 Mar 2008, at 23:41, Jamis Buck wrote:
> From "man nohup":
>
> If the output file nohup.out cannot be created in the current
> directory, the nohup utility uses the directory named by HOME
> to create the file.
>
> My guess is that since "sh -c" doesn't start a login shell, it is
> inheriting the environment of the invoking shell, including the HOME
> environment variable, and is trying to open it there.

Thanks. The man page on your system is a lot more informative than the
one on RHEL5.

Kind regards,
Thijs

--
Fingertips - http://www.fngtps.com


Jamis Buck

unread,
Mar 31, 2008, 6:03:23 PM3/31/08
to capis...@googlegroups.com
On Mar 31, 2008, at 3:46 PM, Thijs van der Vossen wrote:
>
> On 31 Mar 2008, at 23:41, Jamis Buck wrote:
>> From "man nohup":
>>
>> If the output file nohup.out cannot be created in the current
>> directory, the nohup utility uses the directory named by HOME
>> to create the file.
>>
>> My guess is that since "sh -c" doesn't start a login shell, it is
>> inheriting the environment of the invoking shell, including the HOME
>> environment variable, and is trying to open it there.
>
> Thanks. The man page on your system is a lot more informative than the
> one on RHEL5.

OS X for the win! ;)

- Jamis

Thijs van der Vossen

unread,
Mar 31, 2008, 6:11:28 PM3/31/08
to capis...@googlegroups.com


I'll see if they can get me a few nice XServes at RackSpace. ;)

expilo

unread,
Apr 1, 2008, 4:18:39 AM4/1/08
to Capistrano
You can read about nohup in Debian as well :)

Piotr

On 1 Kwi, 00:11, Thijs van der Vossen <t.vandervos...@gmail.com>
wrote:

David Masover

unread,
Apr 1, 2008, 11:13:32 AM4/1/08
to capis...@googlegroups.com
My ubuntu had a fairly unhelpful manpage, which told me to read the info page -- which wasn't installed, so info defaulted to showing me the same manpage.

Much as I don't like OS X, I have to say, Apple wins this one.
Reply all
Reply to author
Forward
0 new messages