Consider running tmux on CoreOS. There when a user logs out from ssh,
that kills all user processes including any background tmux sessions.
The workaround is to run tmux server explicitly. For example, instead
of calling tmux one does something like:

systemd-run --unit "tmux-$USER" --service-type=forking tmux new-session -d
tmux attach

where systemd-run turns tmux process into a long-running service. Now,
this works as systemd supports forking services. However, If I want to
run tmux in a container, this option is not available. Container
managers like docker kills the container when the main process exits.
As tmux server cannot be invoked without forking, that requires to use
a script like:

tmux  new-session -d
while true; do
    sleep 1
    tmux list-sessions > /dev/null 2>&1 || break
done

In reality the script is more complex as it need to propagate the
termination signals to tmux for a clean shutdown. It would be really
nice if all that can be replaced with just doing tmux -F or whatever.


On 21 January 2015 at 10:30, Thomas Adam <tho...@xteddy.org> wrote:
> On 20 January 2015 at 13:09, Igor Bukanov <i...@mir2.org> wrote:
>> Hello,
>>
>> is there an option to start tmux server so the process would not fork
>
> No, I did look at this many moons ago though:
>
> https://github.com/ThomasAdam/tmux-cvs-archived/commit/4ae54388081f3802700eae2ebcd876efcb2714f5.diff
>
> But it's not needed or wanted within tmux.
>
>> and stay in the foreground, like screen -D -m? This will greatly
>> simplify running tmux from a process manager that do not support
>> forking services like supervisord.
>
> That would be the wrong solution.
>
> -- Thomas Adam

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to