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

Calling a script when an Xsession ends



Hi,

is there any generic way to have a script called when an X session is 
terminating? Like an Xsession-end or something?

My situation: I was fiddling with gpg-agent (and seriously think that the 
people who came up with the current design should be shot) and managed to 
start it from a script in /etc/X11/Xsession.d. Now, there is no way to shut 
it down properly, unless a script is called still within the user's context.

The easy way to do it would be to just kill the PID given in $GPG_AGENT_INFO 
when the session is ending, but the design of the startup sequence seems to 
forbid that. If the agent process is not terminated, repeatedly logging in 
and out will flood the system with essentially dead agents.

I know that there are sample scripts in the gpg documentation, but those 
depend on a file in the user directory which is never really removed and 
don't do much to kill agents.

-- 
Got Backup?

Jabber: Shadowdancer at jabber.fsinf.de

Attachment: pgp6_VL7qhDwu.pgp
Description: PGP signature


Reply to: