Starting Up Programs Automatically With LXDE

376 views
Skip to first unread message

Nick Apperley

unread,
Nov 16, 2014, 4:14:51 AM11/16/14
to beagl...@googlegroups.com
Is there a way to automatically startup programs when logging into LXDE? Trying to get a program (shellscript) to automatically run when a user logs in to LXDE.

William Hermans

unread,
Nov 16, 2014, 4:51:23 AM11/16/14
to beagl...@googlegroups.com

eapp...@gmail.com

unread,
Nov 16, 2014, 6:20:07 PM11/16/14
to beagl...@googlegroups.com
Further detail for Nick's post:

We're using the debian 7 armhf lxde sdcard distribution with kernel 3.8.13-bone67 on the Beaglebone Black. 

The objective is to automatically start an embedded java program using a shell script when the user logs on.

1. The script executes properly from the user's home directory when executed in the normal fashion from a terminal, i.e.
       ./start.sh

2. The content of the shell script is straightforward:

#!/bin/sh
# Start jOrgan and autoload the disposition.
java -jar ~/jOrgan-3_20/jorgan.jar

3. To achieve the autostart at login of a specific user we have followed the standard LXDE application startup scenario:
- log in as the user
- edit the autostart file located in    ~/.config/lxsession/LXDE
- add an entry (line) of the form @<application_name>
- save the file and log out
- log in as the user again

4. To test (3) the following lines wre appended to the autostart file.  At login both the leafpad and lxterminal applications were auto-started as intended.

@leafpad
@lxterminal


5) To test running a command from the command line the following line was appended to the autostart file.  This appeared to do nothing at log in other than start the Leafpad application.  The Lxterminal application was not visible.


So, the question is, why does this not work?   How do we get a command-line shell script to execute at login?

Nick Apperley

unread,
Nov 17, 2014, 7:07:06 PM11/17/14
to beagl...@googlegroups.com, eapp...@gmail.com
Automatically starting the shell script when logging into LXDE works fine in a Lubuntu 12.04 VM. For some strange reason the same thing can't be done on the BBB. No error messages appear anywhere, a real mystery. There may be an issue with Java since some of the other shell scripts (not using Java) start up without any issues on the BBB.

William Hermans

unread,
Nov 17, 2014, 8:23:00 PM11/17/14
to beagl...@googlegroups.com
I'd start by checking file permissions, and running processes on both systems. After that, I'm not sure what I'd check, but would depend on what I found after doing multiple google searches.

There has to be something that is different, obviously. However, I'm nearly 100% positive that it has nothing to do with the hardware its self. I say nearly, because like anyone else. I can not know everything.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Apperley

unread,
Nov 19, 2014, 1:32:28 PM11/19/14
to beagl...@googlegroups.com
No, I don't believe that it is the hardware either.  I think that its likely to be either:
- the implementation of debian/LXDE on the ARM platform, OR
- some difference in implementation for the the JAVA SE Embedded jre product compared with the standard JAVA SE jre product

As another test, we replicated the shell script and .desktop file to a standard PC running Lubuntu 12.04 LXDE.  We installed Oracle JAVA SE 1.8.0_25 and the same version of the jOrgan application as used on the ARM platform.  The autostart mechanism and files were identical to what has been set up on the Beaglebone.  The autostart process works flawlessly on the PC.  The onnly difference there is that we were using JAVA SE 1.8.0 on the PC vs JAVA SE Embedded 1.8.0 on the Beaglebone, but I'm stuggling to see that the embedded version of JAVA would create that problem.

The question now is how to isolate this problem further.  Trying to redirect the console output for the JAVA command in the shell script file to a text file does not work.

I don't see how it can be a permissions issue - the scrpt file when invoked manually as the user runs just fine and starts the application.

Are there some log files I can review that might help point to the cause??


Just to recap:

- the autostart process (via the .desktop file located in /etc/xdg/autostart) does execute the shell script file

- if a standard application is added to the shell script file in the user's home directory the application is started as intended

- if a standard command (e.g. ls -l > list.txt) is added ot the shell script file it too is run correctly

- this command, when added to the shell script in the user's home directory does not successfully execute on the Beaglebone (it does on a PC running LUbuntu):

java -jar /home/organ/jOrgan-3_20/jorgan.jar



Eric Apperley
E-Mail:   eapp...@gmail.com  
Mobile:   ++64 21 060 4202

You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/HFQJz0_lrOk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Charles Steinkuehler

unread,
Nov 19, 2014, 6:06:32 PM11/19/14
to beagl...@googlegroups.com
On 11/19/2014 2:29 AM, Eric Apperley wrote:
>
> - this command, when added to the shell script in the user's home directory
> does not successfully execute on the Beaglebone (it does on a PC running
> LUbuntu):
>
> java -jar /home/organ/jOrgan-3_20/jorgan.jar

I don't know what might be causing your particular problem, but looking
at your command above some generic *nix debugging tips come to mind:

* Try specifying a full path to everything (ie: /path/to/java -jar ..)

* Are there any environment variables that might affect the operation of
java if they are present or absent?

* Check all runtime assumptions (effective user, ulimits, environment,
I/O redirects, etc). Often things like cron scripts and startup scripts
execute in "peculiar" environments that cause weird head-scratching
behavior.

--
Charles Steinkuehler
cha...@steinkuehler.net

William Hermans

unread,
Nov 19, 2014, 7:15:06 PM11/19/14
to beagl...@googlegroups.com
Eric, perhaps this is a post "worthy" of stackoverlfow ? There are plenty of very knowledgeable individuals who may have had similar experience with embedded versus "PC" Java implementations.

I honestly do not know much about Java in either case, but my gut instinct tells me this problem has to do with the different platform implementations.



Nick Apperley

unread,
Nov 24, 2014, 5:53:38 PM11/24/14
to beagl...@googlegroups.com
Seems as though there is some strange differences in behaviour going on between the ARM version of LXDE and the x86 version with the way programs are automatically started, specifically the Java ones. Would it be possible to have Robert Nelson look into this issue with LXDE?

William Hermans

unread,
Nov 24, 2014, 7:16:53 PM11/24/14
to beagl...@googlegroups.com
Nick, how about setting up a shell script, something simple that fires up an already included binary when you log in. That is, to make sure it's not the Java library ? Assuming you have not done so already.
Reply all
Reply to author
Forward
0 new messages