LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 02-07-2005, 01:18 AM   #1
meenalborkar
LQ Newbie
 
Registered: Feb 2005
Location: India
Distribution: Redhat Linux 9.0
Posts: 12

Rep: Reputation: 0
login Scripts


Dear all

I want to write a login script, which will open mozilla with default page after a user's login. Please tell me how to write the script? Where to store it and how to run and how to automate it?


anxiously waiting for reply.
Regards
Meenal
 
Old 02-07-2005, 02:06 AM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Depends on your WM/DE (IE: KDE, fluxbox, Gnome, etc)
Which are you using?
 
Old 02-07-2005, 07:16 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
If your using a graphical login, you can try creating the .bash_login file in the users home directory and placing whatever programs you want started there.
 
Old 02-09-2005, 01:10 AM   #4
meenalborkar
LQ Newbie
 
Registered: Feb 2005
Location: India
Distribution: Redhat Linux 9.0
Posts: 12

Original Poster
Rep: Reputation: 0
login scripts

Hi all
Thanks for quick reply. I am using ICE wm. I can create .bash_login file but can you forward me some sample files and the procedure how to activate and run it. Waiting For Reply.



Thanks

Regards

Meenal
 
Old 02-09-2005, 01:43 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
This one might help.
 
Old 02-09-2005, 03:48 AM   #6
meenalborkar
LQ Newbie
 
Registered: Feb 2005
Location: India
Distribution: Redhat Linux 9.0
Posts: 12

Original Poster
Rep: Reputation: 0
login script

Hi all

I did everything in .xinitrc but no effect. At command prompt I am typing mozilla to get browser open. But same command is not working in .xinitrc file. It is having -rwxr--r-- permissions.


Please help me.
 
Old 02-09-2005, 07:41 AM   #7
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Re: login script

Quote:
Originally posted by meenalborkar
Hi all

I did everything in .xinitrc but no effect. At command prompt I am typing mozilla to get browser open. But same command is not working in .xinitrc file. It is having -rwxr--r-- permissions.


Please help me.
Because that file is not made or used to start programs at the start of X. Did you try the .bash_login ?
 
Old 02-09-2005, 08:07 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Re: Re: login script

Quote:
Originally posted by trickykid
Did you try the .bash_login ?
In my opinion that is not the way as .bash_login is also executed when a login is done from a (normal) terminal instead of using X.

@meenalborkar: did you have a look at this page? It describes the IceWM configuration files.

BTW it is the first hit with a google search on icewm startup

Last edited by Wim Sturkenboom; 02-09-2005 at 08:36 AM.
 
Old 02-11-2005, 09:58 PM   #9
meenalborkar
LQ Newbie
 
Registered: Feb 2005
Location: India
Distribution: Redhat Linux 9.0
Posts: 12

Original Poster
Rep: Reputation: 0
Unhappy login script

Hi all

I tried to create .Xclient.default in icewm dir. still not getting the solution. frustated. help me. do you require some more details?


regards
meenal
 
Old 02-12-2005, 04:18 AM   #10
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
I'm assuming you are logging in from a graphical login. First... use .xsession not .xinitrc. There is a difference which is biting you here.

It can be done.

opera -newpage http://www.google.com &

Or whatever before you have the line with exec and your windowmanager's name.

But this overrides the default behavior of the windowmanager and might be ignored by kdm or gdm if they see the file is not executable. It is possible to do this independant of windowmanger.

If you want to do this for all users then you are going to have to do it independant of the windowmanager. Investigate Xsession for the display manager of your choice.

/usr/X11R6/lib/X11/xdm/Xsession for xdm. You can add commands to be run in this file. Be very careful and test well.

EDIT: Please note, you must run this command before the user's .xsession is executed (as their .xsession never returns until they logout) and it must be run in the background.

Last edited by frob23; 02-12-2005 at 04:26 AM.
 
Old 02-12-2005, 04:49 AM   #11
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
Okay, a little playing around on my home system. Keep in mind, I use xdm as my display manager. The process is similar if you use kdm or gdm but the files will be different.

One thing that you should do, if you are making a global change like this, is have a way to opt-out for your users. Tina may love this but it could drive Joe flipping nuts. The way I solved this problem in my tooling around was just creating a file if you want to run the homepage program.

/usr/X11R6/lib/X11/xdm/Xsession [snippet]
Code:
openhomepagep=$HOME/.xsession.homepage

# The following block checks to see if the file ~/.xsession.homepage exists.
# If it does, regardless of the contents, execute the following commend.  In
# a more extendable situation the file could be setup to contain the default
# command and then executed here instead of the command.  This file would
# have to return and must not be called with exec.
# In either case, this can be made the default by configuring the system to
# include this file (with the contents desired if the later route is taken)
# with each new user.
if [ -e "$openhomepagep" ]; then
        firefox &
fi
I think the comments explain it pretty well. In this case I made it pretty static. No need to do anything funky with the file... it just needs to exist. If it does then firefox will be run in the background for that user. If it doesn't then nothing will be run. You just put this right before the block testing for .xsession.

There are other ways to do this depending on your system. If you want EVERYONE to always have it unless they specifically opt-out, then you can reverse the test and run firefox if the file is not found. So the user would need to create the file to stop it from running instead of remove it. And of course, the comments talk about using a more dynamic system where you call a user modifiable script to start the web-browser -- if the script exists.

Basically, have fun with this. But make sure you keep it so that the least amount of users are likely to be bothered by it. If you are the only user and will remain the only user... then you can do it however you like (I recommend ~/.xsession for that case... leave the global files alone).

Last edited by frob23; 02-12-2005 at 04:51 AM.
 
Old 02-17-2005, 04:26 AM   #12
meenalborkar
LQ Newbie
 
Registered: Feb 2005
Location: India
Distribution: Redhat Linux 9.0
Posts: 12

Original Poster
Rep: Reputation: 0
Unhappy login script not working

Hi all

Frob23 thank you very much. I tried this solution also, but unfortunately it is not working. Here is my setup,

We are having Redhat 9.0 server, which is serving to 40 HCL thin clients. On thine clients ICE sessions are there On this setup whenever a user logs in I want to open mozilla with a default page.

Thank You. With Best Regards



Meenal
 
Old 02-17-2005, 09:36 AM   #13
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Am I stupid or is the answer in the link that I gave before?
Code:
The startup file can list apps you want to start at IceWM startup.
It can look like this: 

idesk& 
(sleep 2; psi&)&

Do not forget to make this file executable 
chmod +x startup

Note: Do not put shell specification (like #!/bin/bash) on the
beginning of the file. Also make sure all applications are 
starting at background (&).

Last edited by Wim Sturkenboom; 02-17-2005 at 09:39 AM.
 
Old 02-17-2005, 10:45 PM   #14
meenalborkar
LQ Newbie
 
Registered: Feb 2005
Location: India
Distribution: Redhat Linux 9.0
Posts: 12

Original Poster
Rep: Reputation: 0
Login Script

Dear All,

Wim don't get angry. I tried your solution also. I followed your link, previously given. As per your instructions I created Startup file. In that I wrote the command to start mozilla. But still it is not working. My startup file looked like

mozilla &



Is it correct? I am trying very hard for the problem.

Thanks for help. Anybody please suggest me the solution.


With Best Regards.


Meenal
 
Old 02-17-2005, 11:10 PM   #15
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
OK, did not know that you tried it. I'm not using ICE, just did the effort to look it up on the net for you.
 
  


Reply



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
Login Scripts??? Help Orian Linux - Newbie 3 11-12-2005 01:29 PM
Login Scripts DarkNecromancer Linux - General 4 05-11-2005 09:26 AM
Executing scripts upon login jungatheart Linux - Newbie 3 04-19-2004 06:06 PM
login scripts? C++freak Linux - Networking 5 08-08-2003 10:15 AM
Login Scripts ppuddick Linux - Networking 2 03-24-2003 08:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration