LinuxQuestions.org
Help answer threads with 0 replies.
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 03-18-2009, 06:47 AM   #1
laurens
Member
 
Registered: Mar 2009
Posts: 65

Rep: Reputation: 15
Find and delete logout script


Hi all,

I have to remove (or deactive) a script a previous system administrator installed on a server. When a user logs out, when you type exit, the following is displayed:
Code:
logout
updating slocate database
I did some research and thought I solved it when I found a script slocate.cron in /etc/cron.daily and moved it to a temp folder. But didn't helped!

Thanks in advance!
 
Old 03-18-2009, 06:52 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 39
Check for a file called .logout in the users' home directory. If its running the slocate update, rename it, remove it, or remove executable permissions from that file.
 
Old 03-18-2009, 07:07 AM   #3
laurens
Member
 
Registered: Mar 2009
Posts: 65

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by arungoodboy View Post
Check for a file called .logout in the users' home directory. If its running the slocate update, rename it, remove it, or remove executable permissions from that file.
Thanks for the reply but I cannot find anything like that there. By the way, there are like 45 user folders in the home dir...

Last edited by laurens; 03-18-2009 at 07:10 AM.
 
Old 03-18-2009, 07:18 AM   #4
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 39
Hmm.. I did a quick search and can't seem to find the global equivalent of .logout. Anyway just to clarify, did you check /home/user1/.logout instead of /home/.logout?
Also if this is happening for each shell that is closed, you might also want to check for the existence of something like /home/user1/.bash_logout or /etc/bash.logout.
 
Old 03-18-2009, 07:24 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Take a look in
/etc/bash.bashrc
 
Old 03-18-2009, 07:57 AM   #6
laurens
Member
 
Registered: Mar 2009
Posts: 65

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by arungoodboy View Post
Hmm.. I did a quick search and can't seem to find the global equivalent of .logout. Anyway just to clarify, did you check /home/user1/.logout instead of /home/.logout?
Also if this is happening for each shell that is closed, you might also want to check for the existence of something like /home/user1/.bash_logout or /etc/bash.logout.
Thx for the effort. I found both those files but they contain only these 2 lines:
Code:
# ~/.bash_logout

clear
As for /etc/bashrc it contains this:
Code:
# /etc/bashrc

### thijs wil kleur
alias ls='ls --color=tty'

if [ $UID -gt 99 ] && [ "`id -gn`" = "`id -un`" ]; then
        umask 002
else
        umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
        xterm*)
                if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
                        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
                else
                PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$
                fi
                ;;
        screen)
                if [ -e /etc/sysconfig/bash-prompt-screen ]; then
                        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
                else
                PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$$
                fi
                ;;
        *)
                [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/et$
            ;;
    esac
    # Turn on checkwinsize
    shopt -s checkwinsize
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
fi

if ! shopt -q login_shell ; then # We're not a login shell
        for i in /etc/profile.d/*.sh; do
            if [ -r "$i" ]; then
                . $i
            fi
        done
        unset i
fi
# vim:ts=4:sw=4
 
Old 03-18-2009, 09:19 AM   #7
kpraveen455
Member
 
Registered: Feb 2009
Location: Hyderabad
Distribution: fedora
Posts: 33

Rep: Reputation: 17
I did looked into it and actually I don't know which are all scripts will be executed
when user ends his session (logout)

But nevertheless there should also be some indirect way:
(Correct me if I am wrong!!!)
First we have to know actually which script does this updation? So try to grep the string "updating slocate database" like as shown below:

grep -R "updating slocate database" .

From this try to get which all scripts are trying to do this activity and remove/deactivate those scripts.

Please also let me know if it works!!!
 
Old 03-18-2009, 10:17 AM   #8
laurens
Member
 
Registered: Mar 2009
Posts: 65

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kpraveen455 View Post
I did looked into it and actually I don't know which are all scripts will be executed
when user ends his session (logout)

........grep -R "updating slocate database" .
It's executing, yet one hour. I'll let you know
(Maybe there is an option to give the search process absolute priority? to speed it up a little)

Last edited by laurens; 03-18-2009 at 10:31 AM.
 
Old 03-18-2009, 11:12 AM   #9
SlowCoder
Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Rep: Reputation: 38
Quote:
Originally Posted by laurens View Post
It's executing, yet one hour. I'll let you know
(Maybe there is an option to give the search process absolute priority? to speed it up a little)
Check out the 'nice' command. Though I've never used it, I understand that increasing the priority too much could yield a nonresponsive system until the program is finished.
 
Old 03-18-2009, 03:32 PM   #10
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
Dont know if it will help, but each user on my system as a ".bash_logout"
Code:
 cat .bash_logout
# ~/.bash_logout: executed by bash(1) when login shell exits.

# when leaving the console clear the screen to increase privacy

if [ "$SHLVL" = 1 ]; then
    [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi
Hope that helps
 
Old 03-19-2009, 01:21 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
Could be in /etc/profile, /etc/bashrc, see also the user's .bashrc, .bash_profile. Could be set as a fn in there. He may also have altered the example in /etc/skel, if there is one.
 
  


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
Delete files script using Find and Tar Zypher123 Red Hat 1 12-12-2008 09:45 AM
KDE logout script - where is it? Riddick Linux - Software 7 09-08-2005 04:02 PM
.logout script On NetBSD EECore *BSD 0 07-10-2005 12:27 PM
Logout button hard to find WMD LQ Suggestions & Feedback 9 05-17-2005 06:29 AM
logout script jaraju Linux - General 1 02-25-2005 10:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:52 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