LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-18-2008, 12:30 PM   #16
K.out
LQ Newbie
 
Registered: Oct 2008
Posts: 23

Original Poster
Rep: Reputation: 1

Mr. C,
I read those links. I just tried calling the script in /etc/gdm/PostLogin/Default and then placing the script in /etc/gdm/PostLogin/Default. I called gdm-safe-restart as well after doing this. I logged out logged, logged back in, and this was not the solution.
 
Old 10-18-2008, 12:34 PM   #17
K.out
LQ Newbie
 
Registered: Oct 2008
Posts: 23

Original Poster
Rep: Reputation: 1
evaluatinglinux,

When my script is in /usr/local/bin and I call it from /etc/profile the script writes to the database upon login; however, it writes 14 new entries to the table everytime I login. I only want it to write one entry to the table every time I login. If i just call the script from the command line in the terminal, it works as desired. I just can not figure out why it is writing 14 entries to the database everytime when called from /etc/profile.
 
Old 10-18-2008, 03:45 PM   #18
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
In your script called from /etc/profile, or in /etc/profile itself, add the statement:

Code:
{ echo -e "\n\nPID: $$  PPID: $PPID" ; ps axjf ;}  >> /tmp/PIDs
Then, logout/in, and look at the process ID (PID) and examine the 14 process tree groupings that follow. Find the process id listed at the top of each grouping labeled PID. This should give you an indication of what was being called, and by which process.
 
Old 10-18-2008, 06:52 PM   #19
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Quote:
Originally Posted by K.out View Post
Mr. C,
I read those links. I just tried calling the script in /etc/gdm/PostLogin/Default and then placing the script in /etc/gdm/PostLogin/Default. I called gdm-safe-restart as well after doing this. I logged out logged, logged back in, and this was not the solution.
I think PostLogin is not available in your version. From the gdmtalk.pdf I referenced:

Quote:
3 Initialization Scripts

Note that the PostLogin/ is a very new addition which at the time of writing is only in CVS. It will be available in versions 2.4.2.x and higher.
And you have 2.20.3. Try PreSession or PostSession. Be sure there are no other files in the directory you choose that meets the criteria for startup file selection, or add your stuff appropriately.
 
Old 10-19-2008, 08:07 PM   #20
K.out
LQ Newbie
 
Registered: Oct 2008
Posts: 23

Original Poster
Rep: Reputation: 1
Thank you for the help. It is fixed now; I decided to just use an if statement to check if it was the first process. Then I call my script if it is.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron job running PHP script to update MySQL - access denied error Beauford2008 Linux - Newbie 9 09-24-2008 08:17 PM
WinXP pro don't run "logon script = logon.bat" Bengt7jqb Linux - Server 2 04-13-2008 01:11 PM
PHP writing to database shmuck Programming 2 03-08-2008 07:39 PM
Shell Script: want to insert values in database when update script runs ring Programming 2 10-25-2007 11:48 PM
write an update query in shell prompt to update the database in sqlserver suchi_s Programming 2 09-29-2004 08:27 AM


All times are GMT -5. The time now is 12:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration