Hello,
I want to start one application after logging in from GDM, and nothing else - I don't want any of the normal desktop environment. I've been testing with a few different apps, such as gnome-terminal, but so far my attempts have failed.
I'm getting an error that says "no profile for user test found", and then I get logged out again.
What I've done so far is create a .xsession file, changed the permissions to 700, and added the following to the file:
exec gnome-terminal &
I know that won't give me any gnome settings, etc., but I'm just playing around at the moment. All I want to do for now is get gnome-terminal started.
Thanks,
Ranbir
On 24Jan2007 16:51, Kanwar Ranbir Sandhu m3freak@rogers.com wrote: | I want to start one application after logging in from GDM, and nothing | else - I don't want any of the normal desktop environment. I've been | testing with a few different apps, such as gnome-terminal, but so far my | attempts have failed. | | I'm getting an error that says "no profile for user test found", and | then I get logged out again. | | What I've done so far is create a .xsession file, changed the | permissions to 700, and added the following to the file: | | exec gnome-terminal & | | I know that won't give me any gnome settings, etc., but I'm just playing | around at the moment. All I want to do for now is get gnome-terminal | started.
Get rid of the "&".
The duration of the .xsession script is the duration of your login. Normally you would kick off a few things in the background with "&" (terminals, browsers, whatever) and finally start a window manager _without_ an "&". In this way the script is waiting for the window manager - quitting the window manager logs you out.
So you want to start a single app _instead_ of a window manager.
On Thu, 2007-01-25 at 10:20 +1100, Cameron Simpson wrote:
Get rid of the "&".
The duration of the .xsession script is the duration of your login. Normally you would kick off a few things in the background with "&" (terminals, browsers, whatever) and finally start a window manager _without_ an "&". In this way the script is waiting for the window manager - quitting the window manager logs you out.
So you want to start a single app _instead_ of a window manager.
Thank - that's the explanation I was looking for. I should have realized that backgrounding the terminal wasn't what I wanted to do.
Here's what I ended up doing:
exec /usr/bin/metacity --sm-disable & exec /usr/bin/gnome-terminal --window --full-screen
I think I'm doing that right. I'm not sure if I should have two exec lines. It is working though: when I exit the gnome-terminal, I get logged out, which is exactly what I wanted.
Now I have to try that with Internet Explorer via wine. I don't want to use IE, but a security camera system requires IE in order to access the web GUI. The ultimate goal is to have a dedicated user that when logged in, starts IE, and when closed, logs the user out.
Thanks again for the reply. I really appreciate it!
Regards,
Ranbir
On Wed, 2007-01-24 at 20:41 -0500, Kanwar Ranbir Sandhu wrote:
I don't want to use IE, but a security camera system requires IE in order to access the web GUI.
Seen that. I might be worth investigating whether it really needs IE. It might be doing a dumb check for the web browser user agent string, that you could spoof. Another thing it might be doing is wanting ActiveX. You can add Mozilla plug-ins for that. While they get some derision, you might prefer that more than running MSIE, itself.
On Fri, 26 Jan 2007, Tim wrote:
Date: Fri, 26 Jan 2007 00:21:12 +1030 From: Tim ignored_mailbox@yahoo.com.au Reply-To: For users of Fedora fedora-list@redhat.com To: For users of Fedora fedora-list@redhat.com Subject: Re: Start only one program at login
On Wed, 2007-01-24 at 20:41 -0500, Kanwar Ranbir Sandhu wrote:
I don't want to use IE, but a security camera system requires IE in order to access the web GUI.
Try the PrefBar extension for Firfox. It allows firefox to masquerade as a number of different browsers.
....Brian
Seen that. I might be worth investigating whether it really needs IE. It might be doing a dumb check for the web browser user agent string, that you could spoof. Another thing it might be doing is wanting ActiveX. You can add Mozilla plug-ins for that. While they get some derision, you might prefer that more than running MSIE, itself.
On 24Jan2007 20:41, Kanwar Ranbir Sandhu m3freak@rogers.com wrote: | On Thu, 2007-01-25 at 10:20 +1100, Cameron Simpson wrote: | > Get rid of the "&". | > | > The duration of the .xsession script is the duration of your login. | > Normally you would kick off a few things in the background with "&" | > (terminals, browsers, whatever) and finally start a window manager | > _without_ an "&". In this way the script is waiting for the window | > manager - quitting the window manager logs you out. | > | > So you want to start a single app _instead_ of a window manager. | | Thank - that's the explanation I was looking for. I should have | realized that backgrounding the terminal wasn't what I wanted to do. | | Here's what I ended up doing: | | exec /usr/bin/metacity --sm-disable & | exec /usr/bin/gnome-terminal --window --full-screen | | I think I'm doing that right. I'm not sure if I should have two exec | lines. It is working though: when I exit the gnome-terminal, I get | logged out, which is exactly what I wanted.
Good.
You don't need two exec lines. You don't even need one:-)
Using "exec" _replaces" the shell running the script with the program being called. Normally the called program is a child of the shell. For the last program in a script it can be a tiny performance win to exec it, since the shell is no longer needed.
Using "exec" with a "&" is harmless but also useless.
So I would write:
metacity --sm-disable & exec gnome-terminal --window --full-screen
I normally try to avoid full pathnames to executables - things will just break if the system layout is changed. Do you type full paths at your shell prompt? Rarely I would hope:-) Scripts are no different.
Cheers,
On Mon, 2007-01-29 at 10:34 +1100, Cameron Simpson wrote:
You don't need two exec lines. You don't even need one:-)
Using "exec" _replaces" the shell running the script with the program being called. Normally the called program is a child of the shell. For the last program in a script it can be a tiny performance win to exec it, since the shell is no longer needed.
Using "exec" with a "&" is harmless but also useless.
So I would write:
metacity --sm-disable & exec gnome-terminal --window --full-screen
Thanks for the explanation - that makes sense. Your suggestion also worked just as you said. I'm going to make the change.
I normally try to avoid full pathnames to executables - things will just break if the system layout is changed. Do you type full paths at your shell prompt? Rarely I would hope:-) Scripts are no different.
I originally left the full path out, but then put it back in because I thought it would make it _more_ reliable. The paths aren't ever going to change on this box, unless it comes from upstream.
Your point is valid, though.
Thanks,
Ranbir
At 7:53 PM -0500 1/30/07, Kanwar Ranbir Sandhu wrote:
On Mon, 2007-01-29 at 10:34 +1100, Cameron Simpson wrote:
...
I normally try to avoid full pathnames to executables - things will just break if the system layout is changed. Do you type full paths at your shell prompt? Rarely I would hope:-) Scripts are no different.
I originally left the full path out, but then put it back in because I thought it would make it _more_ reliable. The paths aren't ever going to change on this box, unless it comes from upstream.
...
Full paths decrease reliability, but increase security. The security comes from knowing which binary is being used, even if PATH is modified to include the current directory, or some other such hackery.
I've wanted to this too but could not succeed. Thanks for the great tip. May I further ask: is there an easy way to apply it to all users on the system? I've tried putting the same thing in /etc/X11/xinit/Xsession but it did not work.
Thanks, Khem
On Mon, 2007-01-29 at 10:34 +1100, Cameron Simpson wrote:
On 24Jan2007 20:41, Kanwar Ranbir Sandhu m3freak@rogers.com wrote: | On Thu, 2007-01-25 at 10:20 +1100, Cameron Simpson wrote: | > Get rid of the "&". | > | > The duration of the .xsession script is the duration of your login. | > Normally you would kick off a few things in the background with "&" | > (terminals, browsers, whatever) and finally start a window manager | > _without_ an "&". In this way the script is waiting for the window | > manager - quitting the window manager logs you out. | > | > So you want to start a single app _instead_ of a window manager. | | Thank - that's the explanation I was looking for. I should have | realized that backgrounding the terminal wasn't what I wanted to do. | | Here's what I ended up doing: | | exec /usr/bin/metacity --sm-disable & | exec /usr/bin/gnome-terminal --window --full-screen | | I think I'm doing that right. I'm not sure if I should have two exec | lines. It is working though: when I exit the gnome-terminal, I get | logged out, which is exactly what I wanted.
Good.
You don't need two exec lines. You don't even need one:-)
Using "exec" _replaces" the shell running the script with the program being called. Normally the called program is a child of the shell. For the last program in a script it can be a tiny performance win to exec it, since the shell is no longer needed.
Using "exec" with a "&" is harmless but also useless.
So I would write:
metacity --sm-disable & exec gnome-terminal --window --full-screen
I normally try to avoid full pathnames to executables - things will just break if the system layout is changed. Do you type full paths at your shell prompt? Rarely I would hope:-) Scripts are no different.
Cheers,
Cameron Simpson cs@zip.com.au DoD#743 http://www.cskk.ezoshosting.com/cs/
On Tue, 2007-01-30 at 22:16 -0500, Tony Nelson wrote:
Full paths decrease reliability
Hmm, but if you don't know whether the other thing's environment has the same default search paths as yours (for when making CRON scripts, for example), using the full path removes one potential problem from the equation.
Hi all:
I tried to make the setting apply globally by editing the file /etc/X11/xinit/Xsession file by putting the sames two lines:
##### metacity --sm-disable exec firefox #####
But it did not work. It gives me this error:
"Cannot start the session due to some internal error."
In my case, i would like any user to login to my system and can only use firefox. Could someone please help me to fix it?
Regards, Khem
On Wed, 2007-01-31 at 11:49 +0700, khemera lin wrote:
I've wanted to this too but could not succeed. Thanks for the great tip. May I further ask: is there an easy way to apply it to all users on the system? I've tried putting the same thing in /etc/X11/xinit/Xsession but it did not work.
Thanks, Khem
On Mon, 2007-01-29 at 10:34 +1100, Cameron Simpson wrote:
On 24Jan2007 20:41, Kanwar Ranbir Sandhu m3freak@rogers.com wrote: | On Thu, 2007-01-25 at 10:20 +1100, Cameron Simpson wrote: | > Get rid of the "&". | > | > The duration of the .xsession script is the duration of your login. | > Normally you would kick off a few things in the background with "&" | > (terminals, browsers, whatever) and finally start a window manager | > _without_ an "&". In this way the script is waiting for the window | > manager - quitting the window manager logs you out. | > | > So you want to start a single app _instead_ of a window manager. | | Thank - that's the explanation I was looking for. I should have | realized that backgrounding the terminal wasn't what I wanted to do. | | Here's what I ended up doing: | | exec /usr/bin/metacity --sm-disable & | exec /usr/bin/gnome-terminal --window --full-screen | | I think I'm doing that right. I'm not sure if I should have two exec | lines. It is working though: when I exit the gnome-terminal, I get | logged out, which is exactly what I wanted.
Good.
You don't need two exec lines. You don't even need one:-)
Using "exec" _replaces" the shell running the script with the program being called. Normally the called program is a child of the shell. For the last program in a script it can be a tiny performance win to exec it, since the shell is no longer needed.
Using "exec" with a "&" is harmless but also useless.
So I would write:
metacity --sm-disable & exec gnome-terminal --window --full-screen
I normally try to avoid full pathnames to executables - things will just break if the system layout is changed. Do you type full paths at your shell prompt? Rarely I would hope:-) Scripts are no different.
Cheers,
Cameron Simpson cs@zip.com.au DoD#743 http://www.cskk.ezoshosting.com/cs/
On 02Feb2007 12:24, khemera lin lin.kh@wicam.com.kh wrote: | I tried to make the setting apply globally by editing the | file /etc/X11/xinit/Xsession file by putting the sames two lines: | | ##### | metacity --sm-disable
You need a trailing "&" here. But that is not your problem.
| exec firefox | ##### | | But it did not work. It gives me this error: | "Cannot start the session due to some internal error." | | In my case, i would like any user to login to my system and can only use | firefox. Could someone please help me to fix it?
Modify it like this:
exec >/tmp/session.out.$$ 2>&1 set -x metacity --sm-disable & exec firefox
Let it fail. Then:
cd /tmp ls -ltr session.out.*
Examine the most recent one. It may contain error messages which clarify the problem.
Cheers,