I upgraded a raspberry Pi installation with a Pi 2. But since I upgraded all packages, the autostart does not work anymore:

neither this seems to be working:

sudo nano /etc/xdg/lxsession/LXDE/autostart

nor this:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

the content of the autostart file is:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
# Auto run the browser
@xset s off
@xset -dpms
@xset s noblank
@/usr/bin/epiphany-browser -a --profile ~/.config http://google.de
@sleep 5s # give it time to start
@echo key F11 | xte # simulate pressing the full screen key

How can I configure that the autostart is executed?

  • Stupid question/sanity check: Have you confirmed that the autostart file isn't run by replacing your commands with something really basic? For example, remove everything below '#Auto run the browser' and test '@midori'. – goobering Mar 17 '16 at 16:28
  • Yes I did that. It is simply not exectued. – S.Spieker Mar 17 '16 at 19:54

There's a fairly plausible sounding explanation for your problem in this thread on the raspberrypi.org forums.

/etc/xdg/lxsession/LXDE-pi/autostart

That is the global autostart file, and works for all users... unless they have a user autostart. If the user has an autostart file the global one is ignored and the personal autostart is used. User settings are applied last and take precedence over global settings. Jessie creates a user's autostart file during the install, so changing settings in the global file no longer have any effect.

/etc/xdg/lxsession/LXDE/autostart

That is the "old" location, the new location uses "/LXDE-pi/". The "/LXDE/" directory may exist, but it will be ignored.

The correct location for adding autostart items should be ~/.config/lxsession/LXDE-pi/autostart. It's recommended that you don't use sudo to edit it.

  • Thanks for pointing this out, but I changed the ownership to pi:pi, but that does not work either. – S.Spieker Mar 18 '16 at 7:12
  • 1
    Sorry, could you confirm what you changed the ownership of? That shouldn't be necessary here. – goobering Mar 18 '16 at 8:22
  • -rw-r--r-- 1 pi pi 414 Mar 18 06:55 /etc/xdg/lxsession/LXDE-pi/autostart – S.Spieker Mar 18 '16 at 9:05
  • That isn't going to help here - the user level settings will still take precedence over those settings. You need to copy/paste your commands over to ~/.config/lxsession/LXDE-pi/autostart . – goobering Mar 18 '16 at 9:28
  • 1
    I'm afraid that lands me pretty much out of suggestions. There's a walkthrough here that may include something I've missed, but as far as I can tell this is how autostart configurations are handled. – goobering Mar 18 '16 at 10:58

Experienced the same issue. Here are my findings:

Check if the /home/pi/.config/lxsession/LXDE-pi/autostart file exists. If it exists, it will be used instead of /etc/xdg/lxsession/LXDE-pi/autostart.

View logs (after reboot) in /home/pi/.xsession-errors:

$ cat .xsession-errors
Xsession: X session started for pi at Sat 30 Jul 23:14:04 UTC 2016
localuser:pi being added to access control list
** Message: main.vala:99: Session is LXDE-pi
** Message: main.vala:100: DE is LXDE
** Message: main.vala:131: log directory: /home/pi/.cache/lxsession/LXDE-pi
** Message: main.vala:132: log path: /home/pi/.cache/lxsession/LXDE-pi/run.log

This suggest looking at /home/pi/.cache/lxsession/LXDE-pi/run.log:

$ tail -n30 /home/pi/.cache/lxsession/LXDE-pi/run.log
...

** (epiphany-browser:874): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
--profile must be an existing directory when --application-mode is requested
** Message: app.vala:130: /usr/bin/epiphany-browser exit with this type of exit: 256

...

So I tested the command manually in the terminal (in the GUI). I got some errors:

$ /usr/bin/epiphany-browser -a --profile ~/.config https~://google.de

** (epiphany-browser:1218): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
** Message: Remote error from secret service: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.secrets was not provided by any .service files

** (epiphany-browser:1218): WARNING **: Error caching form data: The name org.freedesktop.secrets was not provided by any .service files

But the browser started anyway...

Played with the /usr/bin/epiphany-browser command and reduced it to /usr/bin/epiphany-browser --profile ~/.config https://google.de.

Then changed the /home/pi/.config/lxsession/LXDE-pi/autostart lines to:

@/usr/bin/epiphany-browser --profile ~/.config https://google.de

And it worked - the browser started.

Tested on:

  • Raspberry Pi 3
  • Debian Jessie

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Raspbian
    Description:    Raspbian GNU/Linux 8.0 (jessie)
    Release:    8.0
    Codename:   jessie
    
  • "Check if the /home/pi/.config/lxsession/LXDE-pi/autostart file exists. If it exists, it will be used" - that saved my day! – Mykhailo Seniutovych Aug 17 at 15:03
up vote 0 down vote accepted

I was able to solve the problem with a cron task.

First I installed the packages:

sudo apt-get install gnome-schedule

The I edited the crontab via:

crontab -e

I added a task after each reboot where I put the browser startup:

@reboot /home/pi/startupscript &

write on these path the autostart - /home/pi/.config/lxsession/LXDE-pi/

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@/usr/bin/chromium-browser --start-fullscreen --incognito "USE URL¨S HERE, IF YOU WANT TO USE MORE THAN ONE USE A SPACE FOR EACH URL"
@/usr/bin/xdotool x y

Also you can change the --start-fullscreen for kiosk, but kiosk needs to kill the process of your app.

Command: pkill chromium

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.