'Gdm autologin repeats autostart

I enabled gdm autologin on kde 4.14.8.

[daemon] 
AutomaticLoginEnable=True 
AutomaticLogin=username

It seems to log in automatically when I first boot the VM, but it runs my autostart script about 25 times. The autostart script mostly just starts konsole. I can, of course, check to see if it's already running, but clearly something is wrong.

Also, I get this error:

Failed to remove greeter program access to the display. Trying to proceed.

I've noticed that .bash_profile never runs with autologin. When I log out and log back in with the password, it does run.

This is how I'm dealing with the problem.

if ! pidof konsole > /dev/null; then
    [[ ! "$PATH" =~  "~/mycustompath" ]] && . ~/.bash_profile
    ...
fi


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source