On Sun, Nov 21, 2021 at 11:39:53PM -0600, David Wright wrote: > On Sun 21 Nov 2021 at 14:16:26 (-0500), Greg Wooledge wrote: > > So then, it would look something like this: > > > > your unison thing & > > unisonPID=$! > > other things you want to run > > magic MATE start command > > kill "$unisonPID" > > I expect that DEs have DontZap set, so that they get a chance to clean > up after themselves. (That's just a guess. I have no idea how X > servers, DEs and DMs interact with each other.) > > I think that my expectation in my earlier post might have been > unrealistic. If you don't map any sort of window, then I'm not sure > that falling out of .xsession would kill a background job. And > zapping the X server likely wouldn't get to the kill command above.
I'm not sure what you're saying here. Are you expecting that the OP is going to "zap" the X server (by which I believe you mean pressing a magic key combination like Ctrl-Alt-Backspace, with an appropriate option set in the xorg.conf file to cause that to terminate the X server) rather than exiting from MATE in the normal manner? I'm expecting that the OP is exiting/logging out of MATE in whatever the normal way is. Further I'm expecting that this normal logout action causes the "magic MATE start command" to terminate, returning control to the .xsession script. We're not "falling out of .xsession" either. It's just a shell script, so it works the way any other shell script works. When the MATE session ends, the .xsession shell script moves on to the next command, which is kill. > So it would seem common sense to use the GUI that unison provides, > even if the window was minimised or iconified (whatever is possible > while the program is still left running). I know nothing about unison itself. That might work, but I can't confirm or deny it. In either case, it doesn't appear to be what the OP wants.