FAQ
Hi, I was searching for the system wide bash_logout and couldn't find any
documentation on it.

If I create a file ~/.bash_logout file it gets executed when the user logs
out but when I create a system wide /etc/bash_logout it doesn't work.

Not what the issue is since I couldn't find anything on that.



TIA, Paul





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos/attachments/20090401/b63f6b38/attachment.html

Search Discussions

  • Christoph Neuhaus at Apr 1, 2009 at 3:34 pm

    Hi, I was searching for the system wide bash_logout and couldn't find any
    documentation on it.
    There is no system wide bash_logout, according to the bash man page,
    CentOS 4.7.

    Instead look at the way a system wide bashrc is included in ~/.bashrc:
    [ -f /etc/bashrc ] && . /etc/bashrc
    You could do the same in ~/.bash_logout:
    [ -f /etc/bash_logout ] && . /etc/bashrc

    If you want to include that line for every new user's ~/.bash_logout, add
    it to the file /etc/skel/.bash_logout, then create the user(s).

    Chris
  • Paul A at Apr 1, 2009 at 3:44 pm
    Thanks chris!


    -----Original Message-----
    From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On Behalf
    Of Christoph Neuhaus
    Sent: Wednesday, April 01, 2009 11:35 AM
    To: CentOS mailing list
    Subject: Re: [CentOS] bash_logout
    Hi, I was searching for the system wide bash_logout and couldn't find any
    documentation on it.
    There is no system wide bash_logout, according to the bash man page,
    CentOS 4.7.

    Instead look at the way a system wide bashrc is included in ~/.bashrc:
    [ -f /etc/bashrc ] && . /etc/bashrc
    You could do the same in ~/.bash_logout:
    [ -f /etc/bash_logout ] && . /etc/bashrc

    If you want to include that line for every new user's ~/.bash_logout, add
    it to the file /etc/skel/.bash_logout, then create the user(s).

    Chris
    _______________________________________________
    CentOS mailing list
    CentOS at centos.org
    http://lists.centos.org/mailman/listinfo/centos
    No virus found in this incoming message.
    Checked by AVG - www.avg.com
    Version: 8.0.238 / Virus Database: 270.11.35/2034 - Release Date: 04/01/09
    06:06:00
  • John Doe at Apr 1, 2009 at 4:17 pm
    From: Paul A <razor at meganet.net>
    Hi, I was searching for the system wide bash_logout and couldn?t
    find any documentation on it.
    If I create a file ~/.bash_logout file it gets executed when
    the user logs out but when I create a system wide /etc/bash_logout it doesn?t
    work.
    Not what the issue is since I couldn?t find anything
    on that.
    The bash man page does not mention any global logout file...

    FILES
    /bin/bash
    The bash executable
    /etc/profile
    The systemwide initialization file, executed for login shells
    ~/.bash_profile
    The personal initialization file, executed for login shells
    ~/.bashrc
    The individual per-interactive-shell startup file
    ~/.bash_logout
    The individual login shell cleanup file, executed when a login
    shell exits
    ~/.inputrc
    Individual readline initialization file

    You could modify the one in /etc/skels but it would only apply to new users, and can be changed by them later...
    Or, you could chown/chmod the ~/.bash_logout and put '. ~/.bash_logout.user' in it...

    JD
  • Kai Schaetzl at Apr 1, 2009 at 4:31 pm

    Paul A wrote on Wed, 1 Apr 2009 11:12:06 -0400:

    If I create a file ~/.bash_logout file it gets executed when the user logs
    out but when I create a system wide /etc/bash_logout it doesn't work.

    Not what the issue is since I couldn't find anything on that.
    AFAIK, there is no basic mechanism that tells to read /etc/bash_whatever for
    each user. For instance if you look in the default ~/.bashrc you will see
    that:

    # Source global definitions
    if [ -f /etc/bashrc ]; then
    . /etc/bashrc
    fi

    You have to do it the same way with bash_logout.

    Kai

    --
    Kai Sch?tzl, Berlin, Germany
    Get your web at Conactive Internet Services: http://www.conactive.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedApr 1, '09 at 3:12p
activeApr 1, '09 at 4:31p
posts5
users4
websitecentos.org
irc#centos

People

Translate

site design / logo © 2021 Grokbase