Thread: shell script when a user logs in

shell script when a user logs in

From
"Campano, Troy"
Date:

Is there a shell script that executes when a user logs into postgresql?

I wanted to do something like this. I modified the pg_ctl shell script so that it emails me when someone users pg_ctl to start/stop/etc the postgresql database.

So I was wondering if there was something similar I could edit to email me when a user logs in and/or logs out from postgresql.

thank you!

~ Troy Campano ~

Re: shell script when a user logs in

From
Oliver Elphick
Date:
On Fri, 2003-01-10 at 18:56, Campano, Troy wrote:
> Is there a shell script that executes when a user logs into
> postgresql?
>
> I wanted to do something like this. I modified the pg_ctl shell script
> so that it emails me when someone users pg_ctl to start/stop/etc the
> postgresql database.
>
> So I was wondering if there was something similar I could edit to
> email me when a user logs in and/or logs out from postgresql.

Assuming this is Unix, you can do this in the login script in the
postgresql home directory.  What this is called varies with the shell
you are using: for Bourne shell it is .profile, for Cshell it is .login,
for bash it is .bash_profile, .bash_login and .profile.

If you are system administrator, you should be able to get the same
information more easily and reliably from the system logs.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "For the LORD is good; his mercy is everlasting; and
      his truth endureth to all generations."
                                     Psalms 100:5