Re: Start only one program at login



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@xxxxxxxxxx> 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@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/



--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list



Relevant Pages

  • Re: Logging out the window manager
    ... it is when you exit a shell that is a login shell. ... > ~/.xinitrc are run after the window manager terminates. ... after the exec. ... need to call the window manager without exec in order commands after ...
    (Debian-User)
  • Re: problem with X
    ... > errors I got in my XFree86 log. ... > and white screen with a lot of dots on it and a black x for the mouse ... Make sure you have KDE or Gnome or whatever window manager installed and then ... # exec gnome-session ...
    (Debian-User)
  • Re: Start only one program at login
    ... |> The duration of the .xsession script is the duration of your login. ... |> manager - quitting the window manager logs you out. ... You don't need two exec lines. ... Normally the called program is a child of the shell. ...
    (Fedora)
  • Re: I quit
    ... Nothing leads to a window manager other than the ... if you have no .xinitrc the default system file ... #exec startkde ... though you can install whatever you want). ...
    (freebsd-questions)
  • Re: getting siginfo from core file
    ... > user's interest to have functional window manager running. ... But, remembering that exec may fail, you could do something as ... Expressed in this posting are my opinions. ... to opinions held by my employer, Sun Microsystems. ...
    (comp.unix.solaris)