mysqld_safe holding open a pty/tty on FreeBSD (7.x and 8.x)

Ed Schouten ed at
Thu Sep 30 07:03:34 UTC 2010

Hi Jeremy,

* Jeremy Chadwick <freebsd at> wrote:
> 1) "mysqld_safe > /dev/null 2>&1 &" never released the tty
> 2) "nohup mysqld_safe > /dev/null 2>&1 &" did release the tty

What happens if you run the following command?

	daemon -cf mysqld_safe

The point is that FreeBSD's pts(4) driver only deallocates TTYs when
it's really sure nothing uses it anymore. Even if there is not a single
file descriptor referring to the slave device, it has to wait until
there exist no processes which have the TTY as its controlling TTY.

The `pstat -t' command is quite useful to figure out whether there is
still a session associated with the TTY.

See the following thread:

 Ed Schouten <ed at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-stable mailing list