You are not logged in.

#1 2006-04-30 22:09:41

augustob
Member
From: Florianópolis, Brazil
Registered: 2006-03-17
Posts: 135

Slim + Conky + Flux: Conky keeps running after logout

Does anyone have this problem?

It's easy to reproduce:
Start Slim
Login to Fluxbox
Run Conky (to the background)
Exit Fluxbox
Unless your login dialog is right on top of it, your Conky instance will be there for all to see. Did anyone come across this problem? I assumed Conky would be killed on logout like every other X app.

Oh, and I've checked: this problem doesn't occur with W/XDM.

Offline

#2 2006-05-01 21:33:49

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: Slim + Conky + Flux: Conky keeps running after logout

I'm using Slim + Conky + Fvwm, but have no such problem.

I'm guessing here, but it might be related to your login_cmd in /etc/slim.conf. I have the following:

login_cmd           exec /bin/sh -login ~/.xinitrc

and I exec my window manager from .xinitrc without any fancy use of %session variable.

Offline

#3 2006-05-02 17:53:25

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Slim + Conky + Flux: Conky keeps running after logout

I have the same problem (was just about to post a thread in here when I saw this) with slim + openbox + conky. I start conky to the background from ~/.xinitrc

I tried your slim entry sh__, but still the same behavior...

Offline

#4 2006-05-02 18:11:57

liem
Member
Registered: 2006-04-29
Posts: 71
Website

Re: Slim + Conky + Flux: Conky keeps running after logout

I'm pretty sure it doesn't matter what WM you use. Got the same problem but I use WindowLabs.

I start conky (and WM) from ~/.xinitrc, and use the same login_cmd as jaboua and sh__.


Sebastian  A. Liem

Offline

#5 2006-05-02 18:54:59

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Slim + Conky + Flux: Conky keeps running after logout

I found a solution: I moved my .xinitrc to ~/.xinitrc.real, and made a new .xinitrc like this:

exec ~/.xinitrc.real

and then I changed my .xinitrc.real like this:

nitrogen --restore &
xmodmap ~/.Xmodmap &
sleep 2 && conky &
urxvtd &
xscreensaver -no-splash &
openbox
killall conky

It seems to work fine.

sh__: Did you start conky from a terminal/.xinitrc or from FVWM's config file(s)?

Offline

#6 2006-05-02 19:27:19

augustob
Member
From: Florianópolis, Brazil
Registered: 2006-03-17
Posts: 135

Re: Slim + Conky + Flux: Conky keeps running after logout

Yeah, that should work but it's really hackish.. I was hoping for a more elegant solution. Thing is I can't really tell if the problem is in Conky or in Slim, or else I'd be mailing the developers by now.

Offline

#7 2006-05-02 19:37:11

liem
Member
Registered: 2006-04-29
Posts: 71
Website

Re: Slim + Conky + Flux: Conky keeps running after logout

Jaboua solution worked for me too. Thanks. File a bug at slim?


Sebastian  A. Liem

Offline

#8 2006-05-02 21:43:44

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: Slim + Conky + Flux: Conky keeps running after logout

jaboua wrote:

sh__: Did you start conky from a terminal/.xinitrc or from FVWM's config file(s)?

From fvwm's InitFunction, so conky gets killed when fvwm exits. Hmm, interesting. Seems like slim does not terminate things that are started from .xinitrc. I guess the problem can be solved by starting conky inside the window manager.

Offline

#9 2006-05-02 21:46:00

augustob
Member
From: Florianópolis, Brazil
Registered: 2006-03-17
Posts: 135

Re: Slim + Conky + Flux: Conky keeps running after logout

sh__ wrote:
jaboua wrote:

sh__: Did you start conky from a terminal/.xinitrc or from FVWM's config file(s)?

From fvwm's InitFunction, so conky gets killed when fvwm exits. Hmm, interesting. Seems like slim does not terminate things that are started from .xinitrc. I guess the problem can be solved by starting conky inside the window manager.

Unfortunately it's not that simple!

Fluxbox's apps file has [startup] {program} entries that serve that purpose. I call conky from that, and the problem persists.

Offline

#10 2006-05-05 21:55:09

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: Slim + Conky + Flux: Conky keeps running after logout

Doesn't fluxbox have a dedicated file that it starts apps from? I recently moved to arch from ubuntu, and when I used fluxbox there, it had a startup file in the .fluxbox directory, where all files were started from (and after taking a look at my backup of it, fluxbox itself was started from there). I did use GDM with that setup, instead of slim, so that may be the reason for the difference.

Offline

#11 2006-05-05 22:22:22

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Slim + Conky + Flux: Conky keeps running after logout

sh__ wrote:

Seems like slim does not terminate things that are started from .xinitrc. I guess the problem can be solved by starting conky inside the window manager.

It's not really a slim problem - it's part of the way shell forking is done.  If I start a shell, and run "a &" and "b &", those processes fork away from the parent process.  Killing that shell will still keep a and b running in the background.

Because conky is forking away like that, there's no way to kill it when the xinitrc process dies.

Conky should actually be able to know when it's X connection has gone down, and exit cleanly then.

Offline

#12 2006-05-06 17:10:50

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: Slim + Conky + Flux: Conky keeps running after logout

phrakture wrote:

It's not really a slim problem - it's part of the way shell forking is done.  If I start a shell, and run "a &" and "b &", those processes fork away from the parent process.  Killing that shell will still keep a and b running in the background.

Because conky is forking away like that, there's no way to kill it when the xinitrc process dies.

Conky should actually be able to know when it's X connection has gone down, and exit cleanly then.

That's true for shells, but since slim is a login manager one would expect different behaviour. Since ~/.xinitrc contains processes started by the user, it seems appropriate that the login manager cleans up those processes (if they are X applications). Otherwise one could start a keylogger or other malicious program from ~/.xinitrc, log out and capture the input of the next user, at least in theory.

Offline

#13 2006-05-06 17:25:50

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: Slim + Conky + Flux: Conky keeps running after logout

It appears that /etc/slim.conf has a  sessionstop_cmd field, which is commented out by default. I'm not sure what sort of command would stop all running x processes, but couldn't this feild be used to end whatever the user has started?

Offline

#14 2006-05-06 21:18:10

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: Slim + Conky + Flux: Conky keeps running after logout

I checked what happens if I start conky from ~/.xinitrc. The result: when I exit the window manager, conky dies. As it should. So I cannot reproduce the original problem.  :?

Offline

#15 2006-05-06 23:09:06

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Slim + Conky + Flux: Conky keeps running after logout

barebones: Maybe it can be used to just "killall conky"? But I can't try it right now though...

sh__ wrote:

I checked what happens if I start conky from ~/.xinitrc. The result: when I exit the window manager, conky dies. As it should. So I cannot reproduce the original problem.  :?

Are your conky drawing to desktop or in it's own window?

Offline

#16 2006-05-07 00:35:45

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: Slim + Conky + Flux: Conky keeps running after logout

jaboua wrote:

Are your conky drawing to desktop or in it's own window?

Own window (drawing to root window shows nothing at all).

Offline

#17 2006-05-07 12:11:16

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Slim + Conky + Flux: Conky keeps running after logout

sh__ wrote:
jaboua wrote:

Are your conky drawing to desktop or in it's own window?

Own window (drawing to root window shows nothing at all).

That might explain it - when conky runs in it's own window, it disappears at exit here too.

Offline

#18 2006-05-07 16:54:30

barebones
Member
Registered: 2006-04-30
Posts: 235

Re: Slim + Conky + Flux: Conky keeps running after logout

I just tried adding

sessionstop_cmd killall conky

to my /etc/slim.conf and it doesn't clear up the problem. SLiM's webpage doesn't even specify what sessionstop_cmd does, so perhaps its not what I think it is, or not implemented yet?

Offline

#19 2006-05-07 18:40:52

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Slim + Conky + Flux: Conky keeps running after logout

sh__ wrote:

That's true for shells, but since slim is a login manager one would expect different behaviour. Since ~/.xinitrc contains processes started by the user, it seems appropriate that the login manager cleans up those processes (if they are X applications). Otherwise one could start a keylogger or other malicious program from ~/.xinitrc, log out and capture the input of the next user, at least in theory.

It's true for shells, yes, but slim just runs a shell. which runs ~/.xinitrc

My point is that you can't clean those processes up because they are forked away and the parent process then has no notion that they exist.

Offline

#20 2006-05-08 16:33:40

augustob
Member
From: Florianópolis, Brazil
Registered: 2006-03-17
Posts: 135

Re: Slim + Conky + Flux: Conky keeps running after logout

I went ahead and filed a bug at their project page in sf.net, linking to this thread. Let's see what they have to say about this.

Offline

#21 2006-05-08 18:36:07

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: Slim + Conky + Flux: Conky keeps running after logout

Ok, now I could reproduce the problem with fvwm. It does not matter if conky is started from ~/.xinitrc or not, it is enough that conky draws to root window.

This is really a problem with slim, caused by the fact that it does not properly reset the display on exit.

I had to try if slim would terminate a simple keylogging program on exit. Alas, it failed. I could capture the input of the next user (including username & password at the slim login prompt). I consider this a major security flaw in slim.

phrakture wrote:

It's true for shells, yes, but slim just runs a shell. which runs ~/.xinitrc

My point is that you can't clean those processes up because they are forked away and the parent process then has no notion that they exist.

Well, this is certainly not good. Consider this from the viewpoint of security in a multiuser environment. It is not the job of the window manager or the user to clean up the session on exit. This is something the login manager is responsible for. When a user exits an X session, the login manager should close all clients and reset the display.

I checked that xdm handles things properly, and from this thread I gather that wdm does as well. Off to write a bug report to slim devs...

Offline

#22 2006-05-22 16:31:46

dhunter
Member
From: Boston, Ma
Registered: 2006-05-22
Posts: 2

Re: Slim + Conky + Flux: Conky keeps running after logout

I had the same problem, multiple instances of conky, xbindkeys...

In my slim.conf I added line

sessionstop_cmd /usr/bin/killall -u %user

Works like a charm.

Offline

#23 2006-05-22 17:51:44

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: Slim + Conky + Flux: Conky keeps running after logout

Of the apps I had multiple instances I chose to start them once, and later on check if thei're running at login. I did like sh__ and started conky in it's own window, so now everything seems to work without killing anything (except the fact that slim is growing). This is my xinitrc now:

if [ `ps -u jaboua|grep urxvtd|wc -l` -lt 1 ]; then
    urxvtd &
fi

if [ `ps -u jaboua|grep dbus-daemon|wc -l` -lt 1 ]; then
        dbus-daemon --session --fork
fi
    

nitrogen --restore
xmodmap ~/.Xmodmap &
xscreensaver -no-splash &
nitrogen --restore &
conky &
pypanel &

exec openbox

In .conkyrc I have this:

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

Offline

Board footer

Powered by FluxBB