On Thu, Apr 18, 2013 at 10:27 AM, Noah Easterly <noah.easte...@gmail.com> wrote:
> I've observed a problem when using nohup within a tmux (in both 1.4 and 1.7)
> session on OSX 10.6.
....
> But once inside tmux, it starts giving errors:
>
>   % tmux
>   % nohup echo hi
>   appending output to nohup.out
>   % cat nohup.out
>   nohup: can't detach from console: Unknown error: 0
>   % nohup echo hi > /tmp/out
>   % cat /tmp/out
>   nohup: can't detach from console: Inappropriate ioctl for device
>
> Is there anything I can do to fix this, or should I file a bug?

I had not previously heard of this problem, but using my "reattach to
reattach to user namespace" wrapper prevents the error(s) (tested on
OS X 10.6.8 and 10.8.3).

    https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard

If you use MacPorts or Homebrew, it is available through them.

If you are using nohup directly, then you can use it like this:

    reattach-to-user-namespace nohup echo foo

The fix is preserved across fork+exec, so you can hoist the wrapper
usage up the chain of parent processes if that is more convenient
(e.g. use the wrapper on a script that uses nohup). You can hoist it
"all the way" up to and use the wrapper in your tmux default-command
(as described in the README.md) so that everything one of you tmux
shells runs is affected.

The problem is that nohup is is being aggressive in its error handling
when it tries to do something that tmux has (more or less) already
done (via daemon(3)). Using the wrapper reestablishes the context that
nohup expects.

You could file a bug report ("nohup fails after daemon"?), but it
might not go anywhere since daemon(3) is already deprecated.

--
Chris

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to