azrith
Posts: 4
Joined: Sat Apr 06, 2013 9:39 pm
Contact: Website

.config/autostart runs twice

Sat Oct 26, 2013 6:11 pm

Hi,

I've setup a Desktop entry in /.config/autostart/ to run a Tkinter Python script. I tried setting it up in rc.local but realized I had to load it after the GUI was up. It is working but it loads twice. Does anyone have any idea why it would load twice? I've tried numerous things and no matter what I do, it always seems to load twice.

Thanks

Update - I modified my .desktop file and set it to launch Midori. I still experience the same thing and Midori launches twice. I verified the same thing happens on my other Raspberry Pi running raspbian wheezy.
I also noticed that if edit the Desktop Session Settings and uncheck Midori, neither instance is launched. It seems like something with LXDE being launched twice but I have no idea where to look.

Update- After digging into this further I check the running processes and it looks like LXDE stuff is getting launched twice somehow. I have the following processes listed twice:
/usr/bin/lxsession -s LXDE -e LXDE
/usr/bin/dbus- launch --exit-with-session x-session-manager
/usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
openbox --config-file /home/pi/.config/openbox/lxde-rc.xml
lxpanel --profile LXDE
pcmanfm --desktop --profile LXDE
I verified similar results on my other pi running wheezy.

azrith
Posts: 4
Joined: Sat Apr 06, 2013 9:39 pm
Contact: Website

Re: .config/autostart runs twice

Tue Oct 29, 2013 2:24 am

Solved!

Well after spending too much time on this, I figured out that Tightvncserver was the culprit. I had tightvnserver in the autostart folder also. Unfortunately, tightnvserver only lets you start virtual desktops on sessions 1+. The default session still starts on 0. Far as I can tell, the tightvnc virtual desktops load the same stuff as the regular session and therefore, have two instances of anything in the startup running. I have a custom Tkinter application where I didn't want two versions running. I wasn't able to find a solution for tightnvserver but I did find the post below which discusses using X11vnc which can run on the 0 instance. I removed tightnvserver, installed x11vnc and presto, only one instance of stuff starting up.

I've got no clue if anyone else has run into this but maybe this post will help those in the future that are linux noobs like me and want to autostart something once and use vnc.
http://www.raspberrypi.org/phpBB3/viewt ... 62#p108862

wsandor
Posts: 1
Joined: Mon Nov 11, 2013 4:22 pm

Re: .config/autostart runs twice

Mon Nov 11, 2013 6:41 pm

Thank you for your post!
It solved my problem.

uncleboarder
Posts: 2
Joined: Wed Dec 18, 2013 2:31 am

Re: .config/autostart runs twice

Wed Dec 18, 2013 2:34 am

Awesome troubleshooting!!

I was going crazy trying to figure this out. Thank-you, thank-you, thank-you.

ntomkin
Posts: 1
Joined: Thu Jul 17, 2014 6:41 pm

Re: .config/autostart runs twice

Thu Jul 17, 2014 6:42 pm

Yes, this saved me as well. Many thanks.

turtlegood
Posts: 7
Joined: Tue Feb 24, 2015 11:45 pm

Re: .config/autostart runs twice

Sun May 29, 2016 9:13 am

Man you save me!!! Words failed me to express my appreciation!!! Thanks!!!!!!!

amilino
Posts: 84
Joined: Fri Feb 05, 2016 6:01 pm

Re: .config/autostart runs twice

Sat Jun 10, 2017 1:04 pm

In my case I have xrdp which is making autostart execution two times. Any solution for xrdp?

Return to “Raspbian”