From owner-freebsd-java Thu Jul 11 15:50:15 2002 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D3AE37B400; Thu, 11 Jul 2002 15:50:02 -0700 (PDT) Received: from ns0.seaman.net (ns0.seaman.net [168.215.64.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id 182C843E42; Thu, 11 Jul 2002 15:50:01 -0700 (PDT) (envelope-from dick@seaman.org) Received: from tbird.internal.seaman.net (tbird [192.168.10.12]) by ns0.seaman.net (8.12.5/8.12.5) with ESMTP id g6BMnxRR000902; Thu, 11 Jul 2002 17:49:59 -0500 (CDT) (envelope-from dick@seaman.org) Received: (from dick@localhost) by tbird.internal.seaman.net (8.11.6/8.11.6) id g6BMnws31116; Thu, 11 Jul 2002 17:49:58 -0500 Date: Thu, 11 Jul 2002 17:49:58 -0500 From: "Richard Seaman, Jr." To: Shannon -jj Behrens Cc: Don Bowman , freebsd-stable@FreeBSD.ORG, freebsd-java@FreeBSD.ORG Subject: Re: linux JRE 1.4 under linux compatibility only runs as root Message-ID: <20020711174958.E32743@seaman.org> Mail-Followup-To: "Richard Seaman, Jr." , Shannon -jj Behrens , Don Bowman , freebsd-stable@FreeBSD.ORG, freebsd-java@FreeBSD.ORG References: <20020711214742.C259A37B406@hub.freebsd.org> <20020711150748.B14694@alicia.nttmcl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020711150748.B14694@alicia.nttmcl.com>; from jj@nttmcl.com on Thu, Jul 11, 2002 at 03:07:48PM -0700 Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, Jul 11, 2002 at 03:07:48PM -0700, Shannon -jj Behrens wrote: > > > I know several other people have run into the problem where > > > the (Linux) JDK or JRE 1.4 will only run as root. > > > Tracing this with 'ktrace', the issue is a statfs call, > > > which returns 'RESTART'. I don't see that errno listed on > > > the man page for statfs, I guess it must come from the > > > linux_statfs in compat/linux. > > > > > > 48927 java CALL statfs(0xbf1f) > > > 48927 java RET statfs RESTART > > > > OK, after having found out that 'ktrace' isn't appropriate > > for linux executables (use truss or linux_kdump), I found that > > the culprit is actually: > > > > linux_sched_getscheduler(0xcb18) ERR#1 'Operation not > > permitted' > > > > when root, this is permitted. When non-root, this is not-permitted. > > > > Suggestions? Is this a problem with the linux emulation? Or is > > there a permissions difference between linux & freebsd here? > > I'm having the same problem. It looks like this has been discussed on -STABLE, > -JAVA, -HACKERS, and -QUESTIONS, but to no avail: > > > > I'm sorry for the redundant cross-post, but this looks like a hard one to > solve. Not hard at all. The perms in sched_getscheduler in -stable are silly. (also sched_getparam). Just try changing it to something like the patch below (note that I don't have a stable system at the moment, so I don't guarantee it works, nor that it even compiles -- take it as a guide only). --- p1003_1b.c.orig Thu Jul 11 17:29:55 2002 +++ p1003_1b.c Thu Jul 11 17:40:51 2002 @@ -211,14 +211,24 @@ int sched_getscheduler(struct proc *p, struct sched_getscheduler_args *uap) { - int e; - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_getscheduler(&p->p_retval[0], ksched, p)) - ); + int e = 0; + struct proc *targetp; - return e; + if (uap->pid == 0) { + targetp = p; + } else { + targetp = pfind(uap->pid); + if (targetp == NULL) { + e = ESRCH; + } + } + + if (e == 0) + e = ksched_getscheduler(&p->p_retval[0], ksched, targetp); + + return (e); } + int sched_yield(struct proc *p, struct sched_yield_args *uap) { -- Richard Seaman, Jr. email: dick@seaman.org 5182 N. Maple Lane phone: 262-367-5450 Nashotah WI 53058 fax: 262-367-5852 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message