News for hackers. Stuff that matters.
Re:Systemd developer asks tmux to add systemd specific code by zxcvcxz on Sunday May 29, 2016 @01:20PM (#11797167)
Am I the only person who likes the idea of being able to logout and log back in again and have all my processes still running and arranged the way I had them? Maybe we just need a "hard logout" option for people who want everything killed.

Usually log outs are already instant so I'm not sure what problem this fixes.

Re:Systemd developer asks tmux to add systemd specific code by chrisper on Sunday May 29, 2016 @01:25PM (#11797193)
If you want your processes to be running the way it is, then just lock your screen or switch user instead of log out. A log out, in my opinion is like a shutdown of the user session. So all user processes should stop running.
Re:Systemd developer asks tmux to add systemd specific code by jitl on Sunday May 29, 2016 @01:32PM (#11797236)
So I should loose my state when I disconnect from my SSH session because my train went through a tunnel? This attitude might make sense on a desktop GUI machine, but in the real world far more developers use Linux remotely over SSH, which is where tmux really shines. I use it to leave my "IDE" (vim and friends) running on my server, so I can resume work remotely from any computer.
Re:Systemd developer asks tmux to add systemd specific code by erikb on Sunday May 29, 2016 @01:49PM (#11797366)
That post is confusing problem with solution. When you lose your ssh connection you are not logging out on purpose. Even ssh can help you there, though. You can configure ssh clients (and also servers I believe) to survive a session to be gone for minutes, even hours if you desire.

So your problem is that you haven't spent enough time learning to configure your ssh according to your needs. The cool thing is that ssh configs can be done for a specific session (if it happens just once in a while or you experiment about the right configuration), it can be done per target (in case you want to react differently on your personal blog and your company development host), and globally (to apply always). Have fun reading. You may find that ssh can solve a lot of problems and in some people's mind even solves problems like other tools but more elegant (I personally prefer it over http-proxys and VPNs as well).

Re:Systemd developer asks tmux to add systemd specific code by jdbernard on Sunday May 29, 2016 @06:49PM (#11798584)
No. I often purposefully log out of an SSH session and expect to come back later and have my tmux session still the same. Sometimes I log out of my desktop at home that I'm physically at, get to someplace else, log in via SSH, and reconnect to the same tmux session I had running when I was at home. This is one of the primary features of tmux. It's not about misconfigured SSH sessions.
Re:Systemd developer asks tmux to add systemd specific code by erikb on Monday May 30, 2016 @03:51AM (#11800133)
Yes you are right. In that case you have tmux to keep your session. If it doesn't do it, it's pretty much tmux's fault. I understood the previous message as if losing the connection on a train ride would be the main issue.
Re:Systemd developer asks tmux to add systemd specific code by jdbernard on Monday May 30, 2016 @10:14AM (#11801437)
How is it tmux's fault when it is systemd that is killing processes? Tmux uses the standard mechanism to inform the system that it should live on, systemd no longer respects that mechanism.
Re:Systemd developer asks tmux to add systemd specific code by kuschku on Sunday May 29, 2016 @01:35PM (#11797255)
And you can continue doing that with systemd – systemd just requires either tmux or you to mark the process specifically as long running, as, by default, processes will be killed during logout.

Making it explicit means you have more control about what will continue to run.

Re:Systemd developer asks tmux to add systemd specific code by Sanddancer on Sunday May 29, 2016 @01:49PM (#11797371)
That functionality has already existed through the way that tmux already does it, via setsid() and daemon(). Systemd killing everything willy-nilly is a bug.
Re:Systemd developer asks tmux to add systemd specific code by pstuart on Sunday May 29, 2016 @01:37PM (#11797273)
The right tool for your scenario is mosh.

https://mosh.mit.edu/

Re:Systemd developer asks tmux to add systemd specific code by jdbernard on Sunday May 29, 2016 @07:06PM (#11798647)
And the right tool for persistent terminal sessions that span SSH, physical access, VNC, and etc. was tmux until systemd broke it in order to poorly address a problem that primarily affects one DE (GNOME).
Re:Systemd developer asks tmux to add systemd specific code by web007 on Sunday May 29, 2016 @01:38PM (#11797276)
This is an argument about tmux (and anciliarily screen) which are built to allow the exact opposite. If you need to run a task that will take a day to run you could NOHUP and background it before logging out for the day, or you launch screen and have it run continuously in the "background" interactively.

I wonder if this breaks mosh as well, if it's anything with per-user persistence.

Re:Systemd developer asks tmux to add systemd specific code by JdeBP on Sunday May 29, 2016 @04:35PM (#11798077)
Re:Systemd developer asks tmux to add systemd specific code by gaius on Sunday May 29, 2016 @01:30PM (#11797218)
The processes the user wants to stop should stop and the ones they want to keep running should keep running. There is enough demand for this capability that there are multiple ways to do it, from disown in the shell, to cron/at, to screen/tmux/emacs and probably more besides.
Re:Systemd developer asks tmux to add systemd specific code by kuschku on Sunday May 29, 2016 @01:34PM (#11797246)
Yes, and the answer for that is systemd-run.

Systemd’s change is just "processes have to explicitly declare they are long-running, or they’ll be killed".

How else would you do it?

Re:Systemd developer asks tmux to add systemd specific code by rkeene2 on Sunday May 29, 2016 @01:45PM (#11797339)
It likely already does "the right thing" according to POSIX. tmux starts a server and then immediately connects to it a client. The server portion is what's being erroneously killed. Starting a server is a relatively normal thing, and one of the steps is to create a new session. setsid() is how you do that. Systemd shouldn't kill processes in a separate session.
Re:Systemd developer asks tmux to add systemd specific code by Sanddancer on Sunday May 29, 2016 @01:42PM (#11797312)
By using the unix tools that have existed since forever and a day. Detatching from the user's session. If a program is broken and doesn't die when it's supposed to, fix the program, not every other program that behaves correctly with functionality that's been around for decades.
Re:Systemd developer asks tmux to add systemd specific code by kuschku on Sunday May 29, 2016 @02:57PM (#11797691)
And that’s exactly the opposite of how you build efficient and secure systems.

This is basically sandboxing time itself.

The bad software will never be fixed. Never. But you can put it in a jail, and let the user configure that good software won’t have that jail.

Re:Systemd developer asks tmux to add systemd specific code by Sanddancer on Sunday May 29, 2016 @03:13PM (#11797772)
The bad software will update itself to continue being bad using the new mechanisms that systemd provides to allow it to be bad. By spending efforts to fix the bad software, or to write better software, you will do much greater things than to break the multitude of software that behaves correctly.
Re:Systemd developer asks tmux to add systemd specific code by gaius on Sunday May 29, 2016 @01:41PM (#11797295)
Re:Systemd developer asks tmux to add systemd specific code by zxcvcxz on Sunday May 29, 2016 @01:31PM (#11797225)
What if you're on shared system like a school computer and you want to be able to log into the same session in different classrooms?

Most systems have a single human user anyway and there is no need for them to log out. For systems that have multiple users it seems more convenient to be able to pick up where you left off.

Re:Systemd developer asks tmux to add systemd specific code by woodman on Sunday May 29, 2016 @01:27PM (#11797202)
> Maybe we just need a "hard logout" option for people who want everything killed.

Maybe we need a way for people to lock their screens without traditionally logging out... wondered the person who implemented the functionality 40 years ago.

Re:Systemd developer asks tmux to add systemd specific code by eronhp on Sunday May 29, 2016 @01:29PM (#11797214)
It has been some time since I used linux, but in Windows, for your first question you just close the lid on your notebook or lock the screen(suspend), and for the "hard logout", you just logout, I thought Ubuntu used to work like this. PS: english is not my first language.