LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-23-2016, 01:09 PM   #1
techie_san778
Member
 
Registered: Jul 2011
Posts: 90

Rep: Reputation: Disabled
Arbitrary numbers on screen after a user logs out


Hello Friends,

I am using RHEL 5.5 on VMWare. Recently, i have been noticing a peculiar problem of random numbers being displayed on screen
after a user logs out.
Log :
[root@desktop ~]#
[root@desktop ~]# su - san
[san@desktop ~]$
[san@desktop ~]$
[san@desktop ~]$ logout

[root@desktop ~]# 1017
1017

[root@desktop ~]#

Notice the 1017. This number changes to some other when next time
i logout.
How to fix it ?? Please suggest me.

Regards

Last edited by techie_san778; 05-23-2016 at 01:11 PM.
 
Old 05-23-2016, 01:17 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
check for jobs before logging out?
What happens if you use 'exit' instead of logout?
How about Control+D? same numbers?
 
Old 05-29-2016, 12:10 AM   #3
techie_san778
Member
 
Registered: Jul 2011
Posts: 90

Original Poster
Rep: Reputation: Disabled
@ Habitual,

I just figured out the matter. When i log into a user's account from root using

[root@desktop ~]# su - san
[san@desktop ~]$ jobs
[san@desktop ~]$ --------> No Jobs.
[san@desktop ~]$ exit
logout

[root@desktop ~]# 1032 ---------> These numbers appear.
1032
In this case Control+D also produces the same result.

But when i login using

[root@desktop ~]# su san
[san@desktop root]$
[san@desktop root]$ exit
exit
[root@desktop ~]#
I don't get any numbers. logout command does not work as this is not login shell.
Well, then why is this difference in outputs ? Any help ?
 
Old 05-29-2016, 10:39 AM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
Something in /home/san/.bash_profile or .bash_login or .profile?
 
Old 05-29-2016, 11:25 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by techie_san778 View Post
@ Habitual,

I just figured out the matter. When i log into a user's account from root using

[root@desktop ~]# su - san
Any user, or just the one?
Does the number increment or is it "random'ish"? (Yes, 'ish is a 'thing')
 
Old 05-29-2016, 11:28 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
Something in /home/san/.bash_profile or .bash_login or .profile?
The difference between
Code:
su san
and
Code:
su - san
is that the inclusion of "-" parses the target user's environment.

So, the offender is in
/home/san/.bash_profile or /home/san/.bash_login or /home/san/.profile

Good catch, keefaz
 
Old 05-31-2016, 03:52 AM   #7
techie_san778
Member
 
Registered: Jul 2011
Posts: 90

Original Poster
Rep: Reputation: Disabled
Hello Habitual,

I checked & found that this error indeed happens only for san user. I also found that
actually there is a script that is supposed to run when san logs out. After disabling the
script, i don't see anymore numbers. They must be the PID's when the script runs.
But the question arises that does the script run only when i log out of san
after logging in using $ su - san and it doesn't when i use $ su san ?
Please give your comments pal.

Last edited by techie_san778; 05-31-2016 at 03:54 AM.
 
Old 05-31-2016, 09:45 AM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
But I just answered that question. Try again.
 
Old 05-31-2016, 01:22 PM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,325

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
If it happens at logout, maybe it's in ~/.bash_logout then

man bash
Code:
When  a  login  shell  exits, bash reads and executes commands from the
file ~/.bash_logout, if it exists.
 
  


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
LXer: Gentoo: 201309-04 Snack: User-assisted execution of arbitrary code LXer Syndicated Linux News 0 09-12-2013 03:12 AM
Mounting arbitrary windows/samba shares as regular user admax88 Linux - General 8 08-04-2011 02:27 AM
[SOLVED] Mint8 Helena LiveCD on USB Stick - Always logs into Mint user, not newly created user rrrssssss Linux Mint 3 04-20-2010 03:14 PM
user's home directory on NFS server--what happens when user logs in from 2 computers? Mountain Linux - Networking 1 03-18-2009 04:35 PM
Firefox logs user out? Where are error logs? case1984 Linux - General 0 10-09-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:16 AM.

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