no controlling tty error

Previous thread: kadmin problem by RJ45 on Monday, February 26, 2007 - 4:52 pm. (6 messages)

Next thread: Almost success: OpenBSD on Xen by Wijnand Wiersma on Monday, February 26, 2007 - 6:44 pm. (5 messages)
To: OpenBSD-Misc <misc@...>
Date: Monday, February 26, 2007 - 5:39 pm

I recently had a crashed disk. I recovered from backup, and made some
changes to fstab.

Now I can't get postgresql to start.

I get an error that no controlling tty. If I try to start it anyway
it tells me that postmaster isn't in the same directory as pg_ctl (but
it is).

Maybe somebody else can spot what I'm missing.

errors:
GTX-440:/root#su - _postgresql
sh: No controlling tty (open /dev/tty: Permission denied)
sh: warning: won't have full job control

$ pg_ctl -D data/ start
sh: cannot create /dev/null: Permission denied
fgets failure: Permission denied
The program "postmaster" is needed by pg_ctl but was not found in the
same directory as "/usr/local/bin/pg_ctl".
Check your installation.

$ locate pg_ctl
/usr/local/bin/pg_ctl
/usr/local/man/man1/pg_ctl.1

$ locate postmaster
/usr/local/bin/postmaster
/usr/local/man/man1/postmaster.1

here's the changes I made to fstab (sd4 is the crashed disk):
$ cat /etc/fstab
/dev/wd0a / ffs rw 1 1
/dev/wd1a /home ffs rw,nodev,nosuid,softdep 1 2
/dev/wd0d /usr ffs rw,nodev 1 2
/dev/wd0b /var/squid/cache/ mfs rw,async,-s=252400 0 0
#/dev/sd0a /usr/obj ffs rw,nodev 1 2
/dev/sd3a /usr/src ffs rw,nodev 1 2
#/dev/sd4a /var/www ffs rw,nodev 1 2
/dev/sd0a /var/www ffs rw,nodev 1 2

--Bryan

To: <root@...>
Cc: OpenBSD-Misc <misc@...>
Date: Monday, February 26, 2007 - 6:04 pm

Use ls(1) to see what's wrong with /dev (probably just empty), then
use MAKEDEV(8) to repair it.

Ciao,
Kili

--
GUIs normally make it simple to accomplish simple actions and impossible to
accomplish complex actions.
-- Doug Gwyn (22/Jum/91 in `comp.unix.wizards')

To: OpenBSD-Misc <misc@...>
Date: Monday, February 26, 2007 - 6:00 pm

this all points to permissions on /dev being wrong.

(cd /dev;sh MAKEDEV all), I would untar the relevant OS distribution
*.tgz over the top as well (with the p flag) to fix up any other files
that may have been broken.

To: OpenBSD-Misc <misc@...>
Date: Monday, February 26, 2007 - 6:21 pm

ah this did it. I'm not sure why it was all messed up. As far as I
recall I didn't mess with /dev hrmmmm

ah well MAKEDEV all fixed it. Everything is ok now.

To: <root@...>
Cc: <misc@...>
Date: Monday, February 26, 2007 - 5:57 pm

Did you tighten up any permissions?

# cd /dev; ls -al tty null
crw-rw-rw- 1 root wheel 2, 2 Feb 26 22:29 null
crw-rw-rw- 1 root wheel 1, 0 Feb 26 22:25 tty

Previous thread: kadmin problem by RJ45 on Monday, February 26, 2007 - 4:52 pm. (6 messages)

Next thread: Almost success: OpenBSD on Xen by Wijnand Wiersma on Monday, February 26, 2007 - 6:44 pm. (5 messages)