LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   script to open application and kill GUI (https://www.linuxquestions.org/questions/linux-desktop-74/script-to-open-application-and-kill-gui-4175446857/)

heshamshokry 01-23-2013 03:24 AM

script to open application and kill GUI
 
Hiii
i installed RHEL 6.2 on computer i have application i want to start this application on the startup normal ok this easy i can do it but now i want the applicaton start without any GUI interface i want user when login on his machine never see any thing exept the application and if he close the application he can't do any thing on the system i know if i give him normal user he can't do any thing but i don't need that i need no thing on the system exept the this application i think this job can be done with script kill gnome-panel and start application but the application requre GUI when i kill gnome panel and start the application the application run again gnome panel :) any one can help me guys ;)

eSelix 01-23-2013 03:57 AM

You can't kill GUI, because it will kill your application, which require it. But you can start another than default programs (the desktop, login manager, etc. are also a separate applications). You did not precised, if you want to login user by gdm or by text console. If the later, then you can specify his default shell (by "usermod -s") as xinit (look "man xinit" for options)
Code:

xinit /usr/bin/my_application
If you want to use gdm to login user, then you can modify X session script to start proper application. There is extensive info about it in "man Xsession", remember about "allow-user-xsession" in Xsession.options file, but in GNOME this can be another file, for example in KDE there is additional scripts in "/etc/kde4/kdm".

heshamshokry 01-23-2013 05:25 AM

thanks boss for your help
yup it works but should i put user name and password to login first i don't need also to put any user and password i want the machine startup without any GDM just open the default app like we do i think its easy

TobiSGD 01-23-2013 07:03 AM

Remove or disable the display manager (GDM, KDM or whatever you use).
Put this in your rc.local, as the last line:[ su -l -c "xinit YOURAPPLICATION" USERNAME[/code]Replace YOURAPPLICATION with the path of your application and USERNAME with the name of the user the application should run on. Now the system should start directly into your application.

heshamshokry 01-27-2013 07:31 AM

every body the problem solved with command of usermod -s /usr/bin/application name done and i disabled the GDM but when i try to do this solution on Ubuntu i can't any one have soluttion how to do the same thing but in ubuntu wait your replay

thanks

heshamshokry 01-28-2013 06:52 PM

any one have a solution please !!!!

Habitual 01-28-2013 07:11 PM

http://goo.gl/Rims

eSelix 01-30-2013 04:59 PM

You should use full stop and comas in your sentences, because your last post is totally not understandable for me.

If you only want to start this one application without password prompt, then I can give you solution which I use to start an XBMC on my secular parents media center PC, there are several approaches, I choose this one. You did not specified which Ubuntu version you use, I assume the latest. Basically you need to add file "/etc/init/tty1.override" to start your application instead of usual "getty", for example:
Code:

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec xinit -- /usr/bin/your_application

Look in /etc/init/tty1.conf for orginal file. Leave other tty?.conf entries for maintance (available after pressing CTRL+ALT+F2, 3, 4, etc.) and disable display manager, by backing up somewhere or creating appropriate empty "*.override" file (I didn't test this), it will be "gdm.conf" or "kdm.conf" or similar in the same directory. After that steps, when computer boot up, it will start your application. Depending on functions in your application you can control its respawning, by deleting or leaving alone "respawn" option, or use script which automatically poweroff when application terminates. Read "man 5 init" for more info.


All times are GMT -5. The time now is 10:21 PM.