From owner-freebsd-current@FreeBSD.ORG Sat Jun 28 03:51:42 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 873A737B401 for ; Sat, 28 Jun 2003 03:51:42 -0700 (PDT) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E10C43FF7 for ; Sat, 28 Jun 2003 03:51:41 -0700 (PDT) (envelope-from arno@heho.snv.jussieu.fr) Received: from heho.snv.jussieu.fr (heho.snv.jussieu.fr [134.157.184.22]) by shiva.jussieu.fr (8.12.9/jtpda-5.4) with ESMTP id h5SApeka061227 ; Sat, 28 Jun 2003 12:51:40 +0200 (CEST) Received: from heho.snv.jussieu.fr (localhost [127.0.0.1]) h5SApehL017669 ; Sat, 28 Jun 2003 12:51:40 +0200 (MEST) Received: (from arno@localhost) by heho.snv.jussieu.fr (8.12.9/8.12.9/Submit) id h5SApdac017666; Sat, 28 Jun 2003 12:51:39 +0200 (MEST) To: "Karl M. Joch" References: <3EFCC896.7050104@kmjeuro.com> From: arno@heho.snv.jussieu.fr Date: 28 Jun 2003 12:51:39 +0200 In-Reply-To: <3EFCC896.7050104@kmjeuro.com> Message-ID: Lines: 62 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Antivirus: scanned by sophie at shiva.jussieu.fr cc: freebsd-current@freebsd.org Subject: Re: 5.1 on a production box with some small problems (su, linux emu 7) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2003 10:51:42 -0000 Karl, > i run 5.1 on one of the inhouse production boxes successful. there are > only 2 small points witch are a pain and i found no solution. box was > fresh setup with 5.0 then cvsuped to 5.1. > > 1. when starting some scripts su doesnt return from the shell and > hangs on boot. when starting manually i get "tty output stopped". with > exit there is a way out of this shell, but i havnt found a > solution. most of the scripts runs since 3.x, at least 4.x and was > working up to 4.8. one of this scripts is the pervasive sql server > startup script which is part of the pervasive server for linux. using > #!/compat/linux/bin/sh doesnt help. there are 2 lines in it starting > sqlmgr and psql with: > echo "commands...." | /bin/su - psql || exit 1 > after the 1st one tty output is stopped. the other script is vmware > and vncserver related and uses linux emu too. I had a similar problem, which has been solved by the following patch posted by David Xu (not white-space clean), you might give it a try. Arno ##### Index: usr.bin/su/su.c =================================================================== RCS file: /home/ncvs/src/usr.bin/su/su.c,v retrieving revision 1.68 diff -c -r1.68 su.c *** usr.bin/su/su.c 8 Apr 2003 16:59:53 -0000 1.68 --- usr.bin/su/su.c 28 Jun 2003 10:33:17 -0000 *************** *** 359,364 **** --- 359,366 ---- child_pid = fork(); switch (child_pid) { default: + sa.sa_handler = SIG_IGN; + sigaction(SIGTTOU, &sa, NULL); close(fds[0]); setpgid(child_pid, child_pid); tcsetpgrp(1, child_pid); *************** *** 366,372 **** sigaction(SIGPIPE, &sa_pipe, NULL); while ((pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) { if (WIFSTOPPED(statusp)) { ! kill(getpid(), SIGSTOP); child_pgrp = getpgid(child_pid); tcsetpgrp(1, child_pgrp); kill(child_pid, SIGCONT); --- 368,376 ---- sigaction(SIGPIPE, &sa_pipe, NULL); while ((pid = waitpid(child_pid, &statusp, WUNTRACED)) != -1) { if (WIFSTOPPED(statusp)) { ! if (WSTOPSIG(statusp) != SIGTTOU && ! WSTOPSIG(statusp) != SIGTTIN) ! kill(getpid(), SIGSTOP); child_pgrp = getpgid(child_pid); tcsetpgrp(1, child_pgrp); kill(child_pid, SIGCONT);