LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-14-2009, 12:29 PM   #1
scmbg
Member
 
Registered: Oct 2008
Location: Mexico City
Distribution: Fedora
Posts: 65

Rep: Reputation: 15
Question Start X server and app at boot time (or services load) time.


Hello, i need to start an application (graphical) when the PC start, even before anybody login, and use/launch a specific user.

Now only can do this manually; when gdm starts, switch to any text tty [ie. Ctrl + Alt + F1], then I login into the special user, start a X server, export the DISPLAY environment variable, and start the application.

With this steps:

Code:
$X :1 -verbose -nr -nolisten tcp &
# Maybe Metacity -> $ metacity
$export DISPLAY=:1
$JavaApp &
Now i need put this steps (script) in some place to launch the app automatically, and with and specific user [ie. manager].

How can i made it? Maybe in init.d? or an special xinitrc?
And how can start the app with the specific user?
And, if is possible, who can stop the app when the system going turn off?

I have Debian 5.0 and a beginner knowledge of shell script.
 
Old 10-15-2009, 06:01 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I saw that Ubuntu Netbook Remix 9.04 offers a login option (either login or go straight to desktop). So it should be possible to boot straight into the graphical environment as a specified user. In the startup of the graphical environment you can add your application.

Some research to do (I can't find the correct search terms to help you)
 
Old 10-15-2009, 08:49 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
These are the first few lines of the [daemon] section in gdm.conf in UNR9.04
Code:
# Automatic login, if true the first attached screen will automatically logged
# in as user as set with AutomaticLogin key.
AutomaticLoginEnable=true
AutomaticLogin=wim

# Timed login, useful for kiosks.  Log in a certain user after a certain amount
# of time.
TimedLoginEnable=true
TimedLogin=wim
TimedLoginDelay=10
My netbook is set to be used without supplying login credentials for the graphical environment. I could not find the man page for gdm.conf on my system, so I leave it to you to get it going on your system.


Ps: there is a little utility called gdmsetup in UNR where you can configure this.

Last edited by Wim Sturkenboom; 10-15-2009 at 08:52 AM. Reason: added PS
 
Old 10-15-2009, 10:52 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Hello scmbg

Like your signature!

Guessing that your system uses Gnome and assuming you are OK with auto-logging-on the user then you can use Gnome's autostart facilities. They can be accessed via /usr/bin/gnome-control-center and thence gnome-session-properties.

Sorry - no idea how to tell the GUI application to close on Linux shutdown but may be possible and is almost certainly application-specific. Which application is it?

Best

Charles
 
Old 10-15-2009, 01:25 PM   #5
scmbg
Member
 
Registered: Oct 2008
Location: Mexico City
Distribution: Fedora
Posts: 65

Original Poster
Rep: Reputation: 15
Hello everyone, and thanks for the answeres.

I think that forget tell information.

1.- I need start this aplication in another tty, for example 8 to switch with [Ctrl + Alt + F8] and keep gdm, in tty8.

2.- I dont want start gnome, or any environment (maybe will Metacity for decorations) to save resources, beacuse in other X server, gnome or kde will be running, as normal user.

3.- The application is a interal Java app for monitring devices.

Thanks and I will try some tricks that you suggest.
 
Old 10-15-2009, 10:34 PM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
With regards to the shutdown question: when a system is shutdown, it sends signals to all running processes. You can code your application to catch those signals (not sure which ones) so it will e.g. close open files.

PS Not much experience with java so I hope it supports it

Last edited by Wim Sturkenboom; 10-15-2009 at 10:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Shorten Linux Boot Time with Services LXer Syndicated Linux News 0 01-20-2009 10:50 AM
hot to auto start oracle application server on Redhat AS3 at the boot time procfs Linux - Software 2 05-22-2007 11:42 PM
a question about starting of services during boot time tuxfood Red Hat 1 04-22-2005 09:59 PM
FC2/FC1: decreasing boot up time by delaying services anandj Fedora 0 06-07-2004 10:22 AM
starting services at boot-time noisybastard Linux - Newbie 2 11-09-2003 05:13 PM


All times are GMT -5. The time now is 05:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration