By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 1096

Summary: kdeinit runs everything in /etc/xdg/autostart twice
Product: TDE Reporter: Jeffry Johnston <trinity>
Component: tdebaseAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED FIXED    
Severity: normal CC: bugwatch, darrella, trinity
Priority: P5    
Version: 3.5.13 [Trinity]   
Hardware: All   
OS: Kubuntu Oneiric   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on:    
Bug Blocks: 503, 831    

Description Jeffry Johnston 2012-07-11 16:06:48 CDT
I use Ubuntu 12.04 (Precise) now (just upgraded), but I noticed this under Ubuntu 11.10 (Oneiric), so I filed with that. 

I started wondering about kdeinit running things twice, when I had two blueman's in my system tray. I fixed that under Oneiric with a patch to blueman (so that it properly detected that it was already running, and so the second invocation did not start a second blueman). Now I installed wicd, and have two wicd's. I know, I just said wicd :) I'm aware of bug report http://bugs.trinitydesktop.org/show_bug.cgi?id=831. I did some work on wicd to try to get it to notice that it was already running, but I wondered why kdeinit seemed to be starting things twice. I did some research and came to the conclusion that neither blueman nor wicd were ultimately to blame, but that kdeinit really was just running them twice.

When I reported this on the IRC channel, the members were understandably incredulous (but very patient, thanks!), so I will again present my evidence for this bug report, step-by-step:

I created the following test program in python, named "/home/calamari/kdeinit-dup-test", and set it executable with chmod +x: 

#!/usr/bin/env python
import os
pid = str(os.getpid())
f = open("/tmp/kdeinit-dup-test_" + pid + ".pid", "w")
f.write("ppid: " + str(os.getppid()) + "\n")
f.close()

That program simply creates a file when run, but part of the file name is the pid. That way each file created will be unique. I also store the ppid (parent process id) inside the file, because I wanted to be sure which program invoked my program. You'll notice that my test program is not persistent; it simply exits when it is done running. Therefore, my test program will not be stored as part of an active session, since it's not running.

I then created a file named /etc/xdg/autostart/jlj.desktop. I based it on wicd-tray.desktop, so there is a lot of generic text, however note that the Exec has been changed so that it executes my test program:

    [Desktop Entry]
    Categories=Application;Network;
    Exec=/home/calamari/kdeinit-dup-test
    GenericName=JLJ
    Icon=wicd-gtk
    Icon[en_US]=wicd-gtk
    Name=JLJ Tray
    Name[en_US]=JLJ Tray
    Comment=Display JLJ status in the system tray
    Comment[en_US]=Display JLJ status in the system tray
    Terminal=false
    Type=Application
    Version=1.0
    X-GNOME-Autostart-enabled=true
    X-KDE-autostart-after=panel

I verified that /tmp contained none of my test files, and then I restarted my computer. Here is what I found after boot was complete:

[asus] ~>ls -alF /tmp/kdeinit*
-rw-rw-r-- 1 calamari calamari 11 Jul 11 13:08 /tmp/kdeinit-dup-test_2248.pid
-rw-rw-r-- 1 calamari calamari 11 Jul 11 13:08 /tmp/kdeinit-dup-test_2259.pid

[asus] ~>cat /tmp/kdeinit*
ppid: 2158
ppid: 2158

[asus] ~>ps ax | grep 2158
 2158 ?        Ss     0:00 kdeinit Running...                                                  
 3859 pts/1    S+     0:00 grep 2158

Therefore, I submit that kdeinit has run my script twice when I booted up. I believe it should have only been run once. Therefore, I feel this behavior is a bug.

--------------------------------------

Additional notes:

An IRC member samelian performed the following test to see if the behavior existed prior to Trinity:
<samelian> calamari: I tried on KDE3
<samelian> but I put the .desktop file on /opt/kde3/share/autostart
<samelian> because seems that kde3 ignore /etc/xdg
<samelian> however, in this way, jlj.desktop is runned only once
<samelian> maybe is a regression in trinity, I have no idea

I attempted to duplicate my test on Trinity, using the /opt/kde3/share/autostart directory, but nothing was created in /tmp, so maybe Trinity does not recognize that as an autostart folder.

Finally, in case you're wondering what it looks like when I run my program manually:
[asus] ~>rm /tmp/kdeinit*
[asus] ~>./kdeinit-dup-test 
[asus] ~>ls /tmp
gpg-h9DNsK/        kde-calamari/        kdeinit-dup-test_2882.pid
ksocket-calamari/  pulse-PKdhtXMmr18n/  pulse-ZRFu5gWfxD0J/
ssh-gnsnRoXI1828/
[asus] ~>cat /tmp/kdeinit-dup-test_2882.pid 
ppid: 2335
[asus] ~>ps ax | grep 2882
 3166 pts/1    S+     0:00 grep 2882
[asus] ~>ps ax | grep 2335
 2335 pts/1    Ss     0:00 /bin/bash
 2946 pts/1    S+     0:00 grep 2335

If I can be of further assistance, please let me know! Thanks.
Comment 1 Jeffry Johnston 2012-07-12 14:36:23 CDT
Tried my test on 3.5.13.1, but still is run twice.
Comment 2 Timothy Pearson 2012-07-25 02:10:28 CDT
Do you use TDE's session management feature (the default)?  If so, can you please show me the contents of 
/home/calamari/.trinity/share/config/session/ after you log out with a wicd instance running?

Thanks!

Tim
Comment 3 Timothy Pearson 2012-07-25 12:41:33 CDT
Fixed in GIT hash e9f29cf.

Thanks for reporting!