[CentOS] Certain scripts "hang" the terminal on logout

Fri Oct 24 15:55:32 UTC 2008
Filipe Brandenburger <filbranden at gmail.com>

Hi,

On Fri, Oct 24, 2008 at 11:48, Sean Carolan <scarolan at gmail.com> wrote:
> # /etc/init.d/script restart  << this runs fine, returns my shell prompt
> # exit  <<  When I enter this command, my shell window just stays
> "stuck" and actually won't close down.
>
> Anyone know why this happens?

Yes, it's because the daemon started from that script keeps file
descriptors opened to the terminal you are connected to. This might be
considered a bug in the daemon, since a proper daemon should close all
its file descriptors before going background and returning to the
shell.

You might try to change the script in init.d to append "</dev/null
>/dev/null 2>&1" at the line that starts the daemon, this might force
it to detach itself from the terminal.

HTH,
Filipe