Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id TAA17250 for postgres-dist; Sun, 27 Mar 1994 19:24:25 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199403280324.TAA17250@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.149.14]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id TAA17241 for <postgres@postgres.Berkeley.EDU>; Sun, 27 Mar 1994 19:24:25 -0800
Received: from localhost (localhost [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.4/8.1B) with SMTP id TAA26734; Sun, 27 Mar 1994 19:24:18 -0800
Message-Id: <199403280324.TAA26734@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
From: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
To: Ken Dueker <ken@newberry.uoregon.edu>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: how to kill locked jobs ? 
Reply-To: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
In-reply-to: Your message of Sun, 27 Mar 1994 17:41:32 -0800 
	     <199403280141.RAA20152@newberry.uoregon.edu> 
Date: Sun, 27 Mar 94 19:24:18 -0800
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-dist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Sun, 27 Mar 94 19:24:25 -0800
Resent-XMts: smtp

Ken Dueker <ken@newberry.uoregon.edu> writes:
> i have gotten into situations were the back-end has locked
> up when i accidentally re-define index's. Unfortunately,
> these jobs are owned by root - and without su password
> i cannot kill these hung jobs. I have combed the doc
> for clues as to how to change the ownership of the back-end
> job to little avail ... any suggestions ?

once a process is running as someone, you can't change it to 
someone else.  that's purely a unix thing, not a postgres 
thing.  the *process* can change its own user id, if the 
executable already has the setuid bit set.  if it's spinning,
there's nothing you can do except kill it as root.  if it's
hung (disk wait or zombie), you can probably only reboot the 
machine.

if you aren't sure what i'm talking about, your sysadmin can
point you at the right unix documentation.

general advice:
don't run postgres as root.  never, ever, ever, ever.  you 
need to talk to your system administrator or whoever installed 
postgres.  postgres should not have to be setuid and it should 
definitely (did i say this before?) never, ever be run as root.

example badness: postgres lets you load arbitrary object code
into a process running as (in your case) root.  someone could
load some code into the backend that removes *your* home
directory.

this is also why it's a bad idea to install postgres as "you"
instead of creating a postgres user.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
