[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to cause a process started in .xsessionrc to terminate with x-session termination?



On Thu 18 Nov 2021 at 15:46:48 -0500, Greg Wooledge wrote:

> On Thu, Nov 18, 2021 at 02:34:52PM -0600, David Wright wrote:
> > On Wed 17 Nov 2021 at 22:39:21 (+0100), Arkadiusz Dabrowski wrote:
> > 
> > > I have a problem with unison sync termination when it is started from
> > > .xsessionrc.
> > > It works flawlessly but when I log out it is orphaned and not terminated.
> > > I start it like this:
> > > nice -n18 ionice -c2 -n7 unison unison_profile &>/dev/null &
> > > Once started the parent is x-session-manager and they the same process
> > > group.
> > 
> > I think this is because you're starting it in the wrong file.
> > Everything in .xsessionrc should complete immediately. Use it
> > to set parameters and things like that.
> 
> I think of .xsessionrc a little differently.  It's the "novice mode" file,
> which you can use regardless of which x-session-manager or x-window-manager
> ultimately gets used, and without needing to take control of your whole
> session yourself.
> 
> That makes it great for quickie "I just want to start xclock too" type
> things, where maintaining a whole .xsession file would be overkill.
> 
> In the OP's case, though, they want something that "novice mode" can't
> handle, so there's a decent reason to move to "advanced mode".

An interesting view. I think of ~/.xsession as being the correct,
traditional and well-tested file for a user to customise an X session
begun with startx or xdm. It never fails to work for novice users.

I think of ~/.xsessionrc in terms of the what is in the changelog for
xorg:

  * Add support for $HOME/.xsessionrc. Closes: #411639
    This file, if present, will get sourced during the start of your
    X session. This allows you to set session-wide environment variables
    easily for things like locale information. Patch adapted from one by
    Yves-Alexis Perez. Thanks also to Holger Levsen and Osamu Aoki for
    advice.

-- 
Brian.


Reply to: