From owner-fam@oss.sgi.com Fri Mar 2 06:57:32 2001 Received: by oss.sgi.com id ; Fri, 2 Mar 2001 06:57:21 -0800 Received: from mirapoint2.brutele.be ([212.68.193.7]:50538 "EHLO mirapoint2.brutele.be") by oss.sgi.com with ESMTP id ; Fri, 2 Mar 2001 06:57:15 -0800 Received: from nexus6.brutele.be ([212.68.216.196]) by mirapoint2.brutele.be (Mirapoint) with ESMTP id ABM99814; Fri, 2 Mar 2001 15:56:09 +0100 (CET) Received: from shellc.jdegreef.net ([192.168.0.2] ident=mail) by nexus6.brutele.be with esmtp (Exim 3.12 #1 (Debian)) id 14YqyS-00009s-00; Fri, 02 Mar 2001 15:56:04 +0100 Received: from jdegreef by shellc.jdegreef.net with local (Exim 3.22 #1 (Debian)) id 14YqyS-0003jS-00; Fri, 02 Mar 2001 15:56:04 +0100 Date: Fri, 2 Mar 2001 15:56:04 +0100 From: Jerome De Greef To: rusty@sgi.com Cc: fam@oss.sgi.com Subject: Re: [fam] imon 0.0.[12]-2.4.0-test9 compile error Message-ID: <20010302155603.A14103@shellc.jdegreef.net> Mail-Followup-To: rusty@sgi.com, fam@oss.sgi.com References: <10102261510.ZM19474@rlyeh.engr.sgi.com> <20010227002453.A8022@shellc.jdegreef.net> <10102261535.ZM19656@rlyeh.engr.sgi.com> <20010227181803.A24218@shellc.jdegreef.net> <10102271828.ZM21720@rlyeh.engr.sgi.com> <20010228180406.A1730@shellc.jdegreef.net> <10102280918.ZM38931@rlyeh.engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i In-Reply-To: <10102280918.ZM38931@rlyeh.engr.sgi.com>; from rusty@rlyeh.engr.sgi.com on Wed, Feb 28, 2001 at 09:17:59AM -0800 X-Editor: Vim http://www.vim.org/ X-Operating-System: Linux/2.4.1 (i686) X-Uptime: 3:35pm up 7:11, 3 users, load average: 0.00, 0.15, 0.15 Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing Hi, * Rusty Ballinger (rusty@rlyeh.engr.sgi.com) wrote: > > > In that earlier message where I said I didn't think imon worked as a > > > module, I was wrong, sick, had been sniffing glue, etc. > > > > Well, the problem is that imon doesn't want to compile as a module. See > > my first mail, it is exactly what I was trying to do... > > Right, sorry. > > I haven't tried to build a 2.4 kernel myself, so I don't know what's > different with the makefiles (or why it doesn't work on your box), but > at the point where it's running the ld command you sent: > > > ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext > > arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o > ... > > --end-group \ > > -o vmlinux > > has fs/imon/imon_static.o been built? If so, if you manually add that > object to the ld command, does the link succeed? (Presumably inside the > --start-group/--end-group flags, but I don't know.) No, at this point imon_static.o is not build. But what I did is, right after I get the error, I did make modules (imon_static.o and imon.o where built) and added imon_static.o in the top Makefile. Then I (re)make bzImage and the kernel finished to build without error. That's probably not the best way to do it ;) but at least it worked. I still have to test it to see if the module load correctly but I'm in remote without X access right now so I will wait to be back home to test that. I must assume I don't know a lot about the kernel build and Makefiles but here is what I think should be modified/done to have imon build as a module: - build imon_static.o before the linking step. Should be added in a Makefile somewhere but I don't know where and how - add imon-static.o in the list of object files needed for linking (in the top Makefile) - remove the build of imon_static.o from the modules building step as it is already built during make bzImage I should probably be able to find how to do that by comparing the build between the module/non module version of imon. We'll see what I'll be able to do this weekend (my girlfriend is visiting me from Norway - I live in Belgium - and I guess I'll not be able to spend all my time on my computer ;) ) Anyway, thanks for your help, Jerome -- +-------------------------------------------------------------------+ | Jerome De Greef | jdegreef@linuxbe.org | jdegreef@brutele.be | +-----------------+ jdegr@geac.com | jdegreef@linuxmail.org | +-------------------------------------------------+ -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Fri Mar 2 07:25:42 2001 Received: by oss.sgi.com id ; Fri, 2 Mar 2001 07:25:21 -0800 Received: from sgi.SGI.COM ([192.48.153.1]:57619 "EHLO sgi.com") by oss.sgi.com with ESMTP id ; Fri, 2 Mar 2001 07:25:01 -0800 Received: from rlyeh.engr.sgi.com ([198.29.76.98]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id HAA09316 for ; Fri, 2 Mar 2001 07:24:47 -0800 (PST) mail_from (rusty@rlyeh.engr.sgi.com) Received: (from rusty@localhost) by rlyeh.engr.sgi.com (SGI-8.9.3/8.9.3) id HAA42085; Fri, 2 Mar 2001 07:24:58 -0800 (PST) From: "Rusty Ballinger" Message-Id: <10103020724.ZM42086@rlyeh.engr.sgi.com> Date: Fri, 2 Mar 2001 07:24:57 -0800 In-Reply-To: Jerome De Greef "Re: [fam] imon 0.0.[12]-2.4.0-test9 compile error" (Mar 2, 3:56pm) References: <10102261510.ZM19474@rlyeh.engr.sgi.com> <20010227002453.A8022@shellc.jdegreef.net> <10102261535.ZM19656@rlyeh.engr.sgi.com> <20010227181803.A24218@shellc.jdegreef.net> <10102271828.ZM21720@rlyeh.engr.sgi.com> <20010228180406.A1730@shellc.jdegreef.net> <10102280918.ZM38931@rlyeh.engr.sgi.com> <20010302155603.A14103@shellc.jdegreef.net> X-Face: #)4}U4e`O6YEe%oBzE}>ycmT!Xt?Myiqo~|p3Wh'UuQ[N7)&4\4?8:1n)bmPX]b@#k94%!VojpODdmk:sCr1b\-aXD&P:wjBqupMB:ag6}BwVseJZM@K{$E|0J9}&,Rpdg{&N4/Y8&PTm6>|r[,gI2T*qN!`AZhl>Bdy7JR`dDvP(/pz.}?Q@dg':mlV`RX51Z_ZG?Gta|Q!iA[MaOh Reply-To: rusty@sgi.com X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail) To: jdegreef@brutele.be Subject: Re: [fam] imon 0.0.[12]-2.4.0-test9 compile error Cc: fam@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing > but here is what I think should be modified/done to have imon build as a > module: > - build imon_static.o before the linking step. Should be added in a > Makefile somewhere but I don't know where and how > - add imon-static.o in the list of object files needed for linking (in > the top Makefile) > - remove the build of imon_static.o from the modules building step as it > is already built during make bzImage It worked something like that for 2.[23] builds; imon_static.o was in the list of files to be built & linked during bzImage, and imon.o was in the list of files built during modules. > I should probably be able to find how to do that by comparing the build > between the module/non module version of imon. (Well... I'm surprised it builds as a non-module--never mind my clueless post earlier when I said I thought it only worked built-in.) > We'll see what I'll be able to do this weekend (my girlfriend is > visiting me from Norway - I live in Belgium - and I guess I'll not be > able to spend all my time on my computer ;) ) Yes, one can never be too careful about repetitive stress injury. On behalf of everyone on the list, let me be the first to advise against her hearing the words, "hold on, let me just see if the kernel links without unresolved symbols..." at any time this weekend. I would hate to see another relationship ruined by fam. --Rusty -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Fri Mar 2 11:25:22 2001 Received: by oss.sgi.com id ; Fri, 2 Mar 2001 11:25:02 -0800 Received: from [65.100.85.34] ([65.100.85.34]:18312 "EHLO roujin.gargoylecc.com") by oss.sgi.com with ESMTP id ; Fri, 2 Mar 2001 11:24:38 -0800 Received: from [65.100.85.35] (IDENT:ringram@gargoyle.gargoylecc.com [65.100.85.35]) by roujin.gargoylecc.com (8.9.3/8.9.3) with ESMTP id DAA09475 for ; Sat, 3 Mar 2001 03:38:06 -0700 Date: Fri, 2 Mar 2001 12:28:29 -0700 (MST) From: Russel Ingram X-Sender: To: Subject: Re: [fam] installing in RH7?? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing Rusty Ballinger wrote: > "Sort of." fam needs to run as root, but since you have root access > on your box, there are (at least) four ways to do this. > > 1. (the best, I think) Get it working through xinetd. (I don't > actually know whether this is possible, since fam uses RPC a bit.) I > will download xinetd and see if I can get it working on my box. Was this ever done? If so, how did it come out? Also, is the patch for imon on a 2.4 kernel truly still based on the 2.4.0-test9 kernel? I want to try imon/fam with the xfs kernel and they are currently working with a 2.4.2(?) kernel base. Has anyone tried this? Thanx, Russ -- --------------------------------------------------------------- "Bill Gates and Microsoft have ruined the computer industry for a long time to come by creating a class of ignorant and lazy computer users." --Russel Ingram "Mommy ... can I go out and ... KILL TONIGHT!?" --Glen Danzig, The Misfits --------------------------------------------------------------- Russ Ingram Gargoyle Computer Consulting (307)742-1361 www.gargoylecc.com -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Wed Mar 7 03:49:43 2001 Received: by oss.sgi.com id ; Wed, 7 Mar 2001 03:49:32 -0800 Received: from sgi.SGI.COM ([192.48.153.1]:63604 "EHLO sgi.com") by oss.sgi.com with ESMTP id ; Wed, 7 Mar 2001 03:49:16 -0800 Received: from rlyeh.engr.sgi.com ([198.29.76.98]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id DAA07475 for ; Wed, 7 Mar 2001 03:49:15 -0800 (PST) mail_from (rusty@rlyeh.engr.sgi.com) Received: (from rusty@localhost) by rlyeh.engr.sgi.com (SGI-8.9.3/8.9.3) id DAA01771; Wed, 7 Mar 2001 03:48:57 -0800 (PST) From: "Rusty Ballinger" Message-Id: <10103070348.ZM1770@rlyeh.engr.sgi.com> Date: Wed, 7 Mar 2001 03:48:57 -0800 In-Reply-To: Russel Ingram "Re: [fam] installing in RH7??" (Mar 2, 12:28pm) References: X-Face: #)4}U4e`O6YEe%oBzE}>ycmT!Xt?Myiqo~|p3Wh'UuQ[N7)&4\4?8:1n)bmPX]b@#k94%!VojpODdmk:sCr1b\-aXD&P:wjBqupMB:ag6}BwVseJZM@K{$E|0J9}&,Rpdg{&N4/Y8&PTm6>|r[,gI2T*qN!`AZhl>Bdy7JR`dDvP(/pz.}?Q@dg':mlV`RX51Z_ZG?Gta|Q!iA[MaOh Reply-To: rusty@sgi.com X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail) To: ringram@gargoylecc.com Subject: Re: [fam] installing in RH7?? Cc: fam@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing > > "Sort of." fam needs to run as root, but since you have root access > > on your box, there are (at least) four ways to do this. > > > > 1. (the best, I think) Get it working through xinetd. (I don't > > actually know whether this is possible, since fam uses RPC a bit.) I > > will download xinetd and see if I can get it working on my box. > > Was this ever done? If so, how did it come out? I didn't get it to work, but that was over 4 months ago, & xinetd may have changed since then. It almost worked--when fam's last client disconnects, fam waits around for a few seconds, and then terminates; under xinetd, there was some problem where it would mark fam as a bad service at that point and unregister it with the portmapper. I never figured out whether the problem was in fam or in xinetd. (Rereading the exchange, it looks like Rob Braun's last question was whether fam was closing fd's 0-2 before exiting. fam doesn't close them explicitly--they're still open when it returns from main()--but just now I tried adding a bit which closes those fd's at that point, and it didn't make a difference. That's with xinetd 2.1.8.9pre11, though, which is a few revisions old.) If you want to try it with a more recent xinetd, here's the /etc/xinetd.d/fam file I was using: service sgi_fam { disable = no type = RPC rpc_version = 1-2 socket_type = stream protocol = tcp wait = yes user = root server = /usr/local/bin/fam # This next bit makes fam run in debug mode, which you # may not want. server_args = -d } I either got that from itox, or someone posted it, or both. --Rusty -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Wed Mar 7 08:03:16 2001 Received: by oss.sgi.com id ; Wed, 7 Mar 2001 08:02:57 -0800 Received: from [65.100.85.34] ([65.100.85.34]:34441 "EHLO roujin.gargoylecc.com") by oss.sgi.com with ESMTP id ; Wed, 7 Mar 2001 08:02:46 -0800 Received: from [65.100.85.35] (IDENT:ringram@gargoyle.gargoylecc.com [65.100.85.35]) by roujin.gargoylecc.com (8.9.3/8.9.3) with ESMTP id AAA19893; Thu, 8 Mar 2001 00:17:08 -0700 Date: Wed, 7 Mar 2001 09:06:51 -0700 (MST) From: Russel Ingram X-Sender: To: cc: Subject: Re: [fam] installing in RH7?? In-Reply-To: <10103070348.ZM1770@rlyeh.engr.sgi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing On Wed, 7 Mar 2001, Rusty Ballinger wrote: > > > "Sort of." fam needs to run as root, but since you have root access > > > on your box, there are (at least) four ways to do this. > > > > > > 1. (the best, I think) Get it working through xinetd. (I don't > > > actually know whether this is possible, since fam uses RPC a bit.) I > > > will download xinetd and see if I can get it working on my box. > > > > Was this ever done? If so, how did it come out? > > I didn't get it to work, but that was over 4 months ago, & xinetd may have > changed since then. It almost worked--when fam's last client disconnects, > fam waits around for a few seconds, and then terminates; under xinetd, > there was some problem where it would mark fam as a bad service at that > point and unregister it with the portmapper. I never figured out whether > the problem was in fam or in xinetd. (Rereading the exchange, it looks > like Rob Braun's last question was whether fam was closing fd's 0-2 before > exiting. fam doesn't close them explicitly--they're still open when it > returns from main()--but just now I tried adding a bit which closes those > fd's at that point, and it didn't make a difference. That's with xinetd > 2.1.8.9pre11, though, which is a few revisions old.) > > If you want to try it with a more recent xinetd, here's the > /etc/xinetd.d/fam file I was using: > > service sgi_fam > { > disable = no > type = RPC > rpc_version = 1-2 > socket_type = stream > protocol = tcp > wait = yes > user = root > server = /usr/local/bin/fam > # This next bit makes fam run in debug mode, which you > # may not want. > server_args = -d > } > > I either got that from itox, or someone posted it, or both. > Thanx, Rusty. I was working on building a service file for xinetd and got hung up on what port it uses (not sure if I had to include that in the file or at least in the /etc/services file or what) so this helps. I will indeed try it again. If I get it to work I will try to create a new rpm that will check to see if there is xinetd or inetd on the system and configure it for the right one. The other problem I have is whether or not there is a version of the imon patches that will apply cleanly to a 2.4.x kernel (non-test). The kernel's I'm working with are from the xfs project (currently a 2.4.2 based tree). thanx, Russ -- --------------------------------------------------------------- "Bill Gates and Microsoft have ruined the computer industry for a long time to come by creating a class of ignorant and lazy computer users." --Russel Ingram "Mommy ... can I go out and ... KILL TONIGHT!?" --Glen Danzig, The Misfits --------------------------------------------------------------- Russ Ingram Gargoyle Computer Consulting (307)742-1361 www.gargoylecc.com -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Wed Mar 7 12:52:19 2001 Received: by oss.sgi.com id ; Wed, 7 Mar 2001 12:51:59 -0800 Received: from sgi.SGI.COM ([192.48.153.1]:26885 "EHLO sgi.com") by oss.sgi.com with ESMTP id ; Wed, 7 Mar 2001 12:51:54 -0800 Received: from rlyeh.engr.sgi.com ([198.29.76.98]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id MAA08265 for ; Wed, 7 Mar 2001 12:51:53 -0800 (PST) mail_from (rusty@rlyeh.engr.sgi.com) Received: (from rusty@localhost) by rlyeh.engr.sgi.com (SGI-8.9.3/8.9.3) id MAA02534; Wed, 7 Mar 2001 12:51:54 -0800 (PST) From: "Rusty Ballinger" Message-Id: <10103071251.ZM2544@rlyeh.engr.sgi.com> Date: Wed, 7 Mar 2001 12:51:54 -0800 In-Reply-To: Russel Ingram "Re: [fam] installing in RH7??" (Mar 7, 9:06am) References: X-Face: #)4}U4e`O6YEe%oBzE}>ycmT!Xt?Myiqo~|p3Wh'UuQ[N7)&4\4?8:1n)bmPX]b@#k94%!VojpODdmk:sCr1b\-aXD&P:wjBqupMB:ag6}BwVseJZM@K{$E|0J9}&,Rpdg{&N4/Y8&PTm6>|r[,gI2T*qN!`AZhl>Bdy7JR`dDvP(/pz.}?Q@dg':mlV`RX51Z_ZG?Gta|Q!iA[MaOh Reply-To: rusty@sgi.com X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail) To: ringram@gargoylecc.com Subject: Re: [fam] installing in RH7?? Cc: fam@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing > If I get it to work I will try to create a new rpm that will check to > see if there is xinetd or inetd on the system and configure it for the > right one. Here's what I wrote for another project which adds stuff to inetd.conf, copied & modified for fam (but not tested). It adds --without-inetd and --with-xinetd flags to the configure script, and if it's configured --with-xinetd, it installs the config file in /etc/xinetd.d and runs killall -USR1 xinetd. Normally, to build rpm packages which work on as many systems as possible, I think you'd want to configure --with-inetd (the default) and --with-xinetd, so it would wind up attempting to add the service to both inetd and xinetd (which is not so good). I'm not real happy with it; do you/anyone have a better approach? (Or a test for xinetdconfdir?) It would probably be better to test for inetd/xinetd at install time, rather than configure time, but I don't think rpm can handle conditionally installed files. (You could install it manually in %post, but then "rpm -qf /etc/xinetd.d/fam" wouldn't know anything about the file, which I don't like.) Anyway, here's what I came up with. In configure.in: AC_ARG_WITH(inetd, [ --without-inetd don't add it to inetd.conf], [inetd=$withval]) AC_ARG_WITH(xinetd, [ --with-xinetd add it to xinetd.d], [xinetd=$withval]) AM_CONDITIONAL(SUPPORT_INETD, test "$inetd" != no) AM_CONDITIONAL(SUPPORT_XINETD, test "$xinetd" = yes) dnl Dude, nice test. xinetdconfdir=/etc/xinetd.d AC_SUBST(xinetdconfdir) In fam/xinetd/Makefile.am (fam/xinetd/fam would be listed in configure.in's AC_OUTPUT so that it would be generated by config.status from fam/xinetd/fam.in, so that the path to the fam executable etc. would be determined by the configure script): if SUPPORT_XINETD xinetdconf_DATA = fam endif EXTRA_DIST = fam.in fam/xinetd/fam.in would look like the xinetd.d entry I sent you before, with @bindir@ instead of the hard-coded path, etc. (Maybe that's the only change.) build/rpm/rpm.spec.in is where it gets ugly: %files ... @SUPPORT_XINETD_TRUE@ %config @xinetdconfdir@/fam ... %post @SUPPORT_INETD_TRUE@ echo "Adding fam to inetd.conf" @SUPPORT_INETD_TRUE@ %{editconf} inetd.conf add '\b(fam|FAM)\b' \ @SUPPORT_INETD_TRUE@ "# fam, the File Alteration Monitor, http://oss.sgi.com/projects/fam/" \ @SUPPORT_INETD_TRUE@ "sgi_fam/1-2 stream rpc/tcp wait root @bindir@/fam fam" @SUPPORT_INETD_TRUE@ echo "Restarting inetd..." @SUPPORT_INETD_TRUE@ killall -HUP inetd || true @SUPPORT_XINETD_TRUE@ echo "Restarting xinetd" @SUPPORT_XINETD_TRUE@ killall -USR1 xinetd || true ... %preun if test "$1" = 0; then ... @SUPPORT_INETD_TRUE@ echo "Removing fam from inetd.conf..." @SUPPORT_INETD_TRUE@ %{editconf} inetd.conf remove '\b(fam|FAM)\b' @SUPPORT_INETD_TRUE@ echo "Restarting inetd..." @SUPPORT_INETD_TRUE@ killall -HUP inetd || true @SUPPORT_XINETD_TRUE@ echo "Restarting xinetd" @SUPPORT_XINETD_TRUE@ killall -USR1 xinetd || true > The other problem I have is whether or not there is a version of the > imon patches that will apply cleanly to a 2.4.x kernel (non-test). The > kernel's I'm working with are from the xfs project (currently a 2.4.2 > based tree). You'd think you could use SGI's imon patch with the kernel version used by SGI's xfs project... Actually, the most recent versions of the imon patch were contributed by E. Brian Gast. There will be a version for 2.4.2 when someone sends one to the list. :) --Rusty -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Sun Mar 11 09:34:55 2001 Received: by oss.sgi.com id ; Sun, 11 Mar 2001 09:34:36 -0800 Received: from orb-catv-1-p022.vtxnet.ch ([212.147.8.22]:39173 "HELO mozilla.developer.ch") by oss.sgi.com with SMTP id ; Sun, 11 Mar 2001 09:34:06 -0800 Received: from developer.ch (unknown [192.168.1.6]) by mozilla.developer.ch (Postfix) with ESMTP id 3A8D32AEEF for ; Sun, 11 Mar 2001 18:33:48 +0100 (CET) Message-ID: <3AABB6FB.6FC57101@developer.ch> Date: Sun, 11 Mar 2001 18:33:47 +0100 From: Atif Ghaffar Reply-To: atif@4unet.net Organization: 4unet SA/AG/Ltd. X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.14 i686) X-Accept-Language: en MIME-Version: 1.0 To: fam@oss.sgi.com Subject: [fam] dnotify Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing Hi, Can dnotify work with fam? http://www.yggdrasil.com/cgi-bin/cvsweb.cgi/linux/Documentation/dnotify.txt?rev=1.1 thanks -- Atif Ghaffar Internet Development Manager 4unet AG/SA -------------------------. +41 78 787 51 45 ¦ voice +41 86 0796598972¦ fax http://www.4unet.net ¦ www http://atif.developer.ch ¦ homepage atif.ghaffar@4unet.net ¦ email Do you speak Unix? -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Mon Mar 12 02:43:45 2001 Received: by oss.sgi.com id ; Mon, 12 Mar 2001 02:43:35 -0800 Received: from sgi.SGI.COM ([192.48.153.1]:7 "EHLO sgi.com") by oss.sgi.com with ESMTP id ; Mon, 12 Mar 2001 02:43:24 -0800 Received: from rlyeh.engr.sgi.com ([198.29.76.98]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id CAA06109 for ; Mon, 12 Mar 2001 02:43:08 -0800 (PST) mail_from (rusty@rlyeh.engr.sgi.com) Received: (from rusty@localhost) by rlyeh.engr.sgi.com (SGI-8.9.3/8.9.3) id CAA21333; Mon, 12 Mar 2001 02:43:21 -0800 (PST) From: "Rusty Ballinger" Message-Id: <10103120243.ZM21359@rlyeh.engr.sgi.com> Date: Mon, 12 Mar 2001 02:43:20 -0800 In-Reply-To: Atif Ghaffar "[fam] dnotify" (Mar 11, 6:33pm) References: <3AABB6FB.6FC57101@developer.ch> X-Face: #)4}U4e`O6YEe%oBzE}>ycmT!Xt?Myiqo~|p3Wh'UuQ[N7)&4\4?8:1n)bmPX]b@#k94%!VojpODdmk:sCr1b\-aXD&P:wjBqupMB:ag6}BwVseJZM@K{$E|0J9}&,Rpdg{&N4/Y8&PTm6>|r[,gI2T*qN!`AZhl>Bdy7JR`dDvP(/pz.}?Q@dg':mlV`RX51Z_ZG?Gta|Q!iA[MaOh Reply-To: rusty@sgi.com X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail) To: aghaffar@developer.ch Subject: Re: [fam] dnotify Cc: fam@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing > Can dnotify work with fam? > http://www.yggdrasil.com/cgi-bin/cvsweb.cgi/linux/Documentation/dnotify.txt?rev=1.1 I'm not very familiar with dnotify myself, but here's what I think: - libfam could probably be rewritten to use dnotify instead of talking to fam on systems where it's available. - One potential problem is that with dnotify, you need one open fd per monitored directory. (Of course, for applications which only monitor one directory anyway, this isn't a problem.) - When an event occurs in a directory, I don't see how to tell which file the event occurred on. Most likely the way fam can benefit most from dnotify is if the imon patch is able to make use of the dnotify hooks in the fs code. I think dnotify & imon have their hooks in the same places; it would be nice if imon could use the same hooks, and be a smaller, less intimidating patch. --Rusty -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Mon Mar 12 04:30:45 2001 Received: by oss.sgi.com id ; Mon, 12 Mar 2001 04:30:36 -0800 Received: from dsl-2-dslam1-31.urbanet.ch ([195.202.196.17]:44549 "HELO convert =?ISO-8859-1?Q?rfc822-to-8bit=06=08v=F7=06=08=11?= lausanne.4unet.net") by oss.sgi.com with SMTP id ; Mon, 12 Mar 2001 04:30:19 -0800 Received: from developer.ch (madmag [172.23.17.210]) by lausanne.4unet.net (Postfix) with ESMTP id 429F623701; Mon, 12 Mar 2001 13:29:51 +0100 (CET) Message-ID: <3AACC13F.26B44561@developer.ch> Date: Mon, 12 Mar 2001 13:29:51 +0100 From: Atif Ghaffar Reply-To: atif@4unet.net Organization: 4unet X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16 i686) X-Accept-Language: en MIME-Version: 1.0 To: rusty@sgi.com Cc: fam@oss.sgi.com Subject: Re: [fam] dnotify References: <3AABB6FB.6FC57101@developer.ch> <10103120243.ZM21359@rlyeh.engr.sgi.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing Hi Rusty, Rusty Ballinger wrote: > - One potential problem is that with dnotify, you need one open fd per > monitored directory. (Of course, for applications which only monitor one > directory anyway, this isn't a problem.) Isnt there a similar problem with imon kernel-patch. I tried to use imon+fam for a file mirroring system for webservers but failed cause I had probs with some kmallocs etc. I have reported this to the list before. Do you know how to fix that problem? I would rather use imon+fam replicating files to a farm of webservers rather than using NBD etc. Best regards. -- Atif Ghaffar Internet Development Manager 4unet AG/SA/Ltd. -------------------------. +41 21 351 53 60 ¦ voice +41 78 787 51 45 ¦ mobile +41 86 0796598972¦ fax http://www.4unet.net ¦ www http://atif.developer.ch ¦ homepage atif.ghaffar@4unet.net ¦ email -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Tue Mar 13 18:28:33 2001 Received: by oss.sgi.com id ; Tue, 13 Mar 2001 18:28:23 -0800 Received: from sgi.SGI.COM ([192.48.153.1]:40557 "EHLO sgi.com") by oss.sgi.com with ESMTP id ; Tue, 13 Mar 2001 18:28:02 -0800 Received: from rlyeh.engr.sgi.com ([198.29.76.98]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id SAA00005 for ; Tue, 13 Mar 2001 18:27:48 -0800 (PST) mail_from (rusty@rlyeh.engr.sgi.com) Received: (from rusty@localhost) by rlyeh.engr.sgi.com (SGI-8.9.3/8.9.3) id SAA30189; Tue, 13 Mar 2001 18:27:42 -0800 (PST) From: "Rusty Ballinger" Message-Id: <10103131827.ZM30425@rlyeh.engr.sgi.com> Date: Tue, 13 Mar 2001 18:27:42 -0800 In-Reply-To: Atif Ghaffar "Re: [fam] dnotify" (Mar 12, 1:29pm) References: <3AABB6FB.6FC57101@developer.ch> <10103120243.ZM21359@rlyeh.engr.sgi.com> <3AACC13F.26B44561@developer.ch> X-Face: #)4}U4e`O6YEe%oBzE}>ycmT!Xt?Myiqo~|p3Wh'UuQ[N7)&4\4?8:1n)bmPX]b@#k94%!VojpODdmk:sCr1b\-aXD&P:wjBqupMB:ag6}BwVseJZM@K{$E|0J9}&,Rpdg{&N4/Y8&PTm6>|r[,gI2T*qN!`AZhl>Bdy7JR`dDvP(/pz.}?Q@dg':mlV`RX51Z_ZG?Gta|Q!iA[MaOh Reply-To: rusty@sgi.com X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail) To: aghaffar@developer.ch Subject: Re: [fam] dnotify Cc: fam@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-fam@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;fam-outgoing > > - One potential problem is that with dnotify, you need one open fd per > > monitored directory. (Of course, for applications which only monitor > > one directory anyway, this isn't a problem.) > > Isnt there a similar problem with imon kernel-patch. No, a FAMConnection has one file descriptor which can be used for all requests. You don't have to keep one open file descriptor per monitored file or directory. > I tried to use imon+fam for a file mirroring system for webservers but > failed cause I had probs with some kmallocs etc. > I have reported this to the list before. Yeah, that's definitely a bug, but I haven't looked into it yet. (Did you try Johan's change, replacing kmalloc/kfree with vmalloc/vfree in imon's hash table code? I think he said it fixed the kmalloc failure but didn't fix the problem, as his stuff was still croaking on the 926th directory. Does that happen on your system too?) --Rusty -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Mon Mar 19 18:39:15 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f2K2dFn16003 for fam-outgoing; Mon, 19 Mar 2001 18:39:15 -0800 Received: from babylon.merseine.nu (c418236-a.clmba1.mo.home.com [24.12.203.134]) by oss.sgi.com (8.11.3/8.11.3) with ESMTP id f2K2d2M15996 for ; Mon, 19 Mar 2001 18:39:12 -0800 Received: (from ishmael@localhost) by babylon.merseine.nu (8.11.3/8.11.3) id f2K2eRE03421 for fam@oss.sgi.com; Mon, 19 Mar 2001 20:40:27 -0600 (CST) (envelope-from ishmael) Date: Mon, 19 Mar 2001 20:40:27 -0600 From: Jeremy Norris To: fam@oss.sgi.com Subject: [fam] Patches to make Fam run on FreeBSD Message-ID: <20010319204027.A3215@babylon.merseine.nu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-fam@oss.sgi.com Precedence: bulk --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The other day I was presented with the following patches from David Rufion , which make Fam compile and successfully run under FreeBSD. I am now able to run the latest CVS version of Enlightenment X11-Window Manager, which utilizes Fam extensively. I asked and received permission from David to post these patches pubically and see about getting them officially integrated into the Fam sources. So here they are. Jeremy --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fam-oss-2.6.4.patch" diff -urN fam-oss-2.6.4/config.h.in fam-oss-2.6.4-freebsd/config.h.in --- fam-oss-2.6.4/config.h.in Sat May 20 05:50:17 2000 +++ fam-oss-2.6.4-freebsd/config.h.in Sun Mar 18 00:02:38 2001 @@ -12,6 +12,8 @@ /* Define if the system has imon and IMONIOC_ ioctl flags. */ #undef HAVE_IMON +#undef HAVE_MNTENT_H + /* Define if the system has the struct revokdi and the IMONIOC_REVOKDI ** ioctl flag. (IRIX 5.3 doesn't.) */ diff -urN fam-oss-2.6.4/configure.in fam-oss-2.6.4-freebsd/configure.in --- fam-oss-2.6.4/configure.in Sat May 20 06:23:17 2000 +++ fam-oss-2.6.4-freebsd/configure.in Sun Mar 18 00:36:29 2001 @@ -95,6 +95,8 @@ dnl AC_HEADER_SYS_WAIT dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h syslog.h unistd.h) +AC_CHECK_HEADER(mntent.h, AC_DEFINE(HAVE_MNTENT_H)) + dnl dnl See if imon is available; if so, is it IRIX or Linux? dnl @@ -299,10 +301,10 @@ dnl If we don't have MNTTYPE_NFS , we croak. dnl -FAM_DECL_IN_MNTENT(MNTTYPE_NFS, ,AC_MSG_ERROR(Didn't find MNTTYPE_NFS in mntent.h)) -FAM_DECL_IN_MNTENT(MNTTYPE_NFS2, AC_DEFINE(HAVE_MNTTYPE_NFS2)) -FAM_DECL_IN_MNTENT(MNTTYPE_NFS3, AC_DEFINE(HAVE_MNTTYPE_NFS3)) -FAM_DECL_IN_MNTENT(MNTTYPE_CACHEFS, AC_DEFINE(HAVE_MNTTYPE_CACHEFS)) +dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS, ,AC_MSG_ERROR(Didn't find MNTTYPE_NFS in mntent.h)) +dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS2, AC_DEFINE(HAVE_MNTTYPE_NFS2)) +dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS3, AC_DEFINE(HAVE_MNTTYPE_NFS3)) +dnl FAM_DECL_IN_MNTENT(MNTTYPE_CACHEFS, AC_DEFINE(HAVE_MNTTYPE_CACHEFS)) dnl dnl Test for bindresvport() prototype. diff -urN fam-oss-2.6.4/fam/Client.h fam-oss-2.6.4-freebsd/fam/Client.h --- fam-oss-2.6.4/fam/Client.h Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/Client.h Sat Mar 17 00:14:35 2001 @@ -23,6 +23,7 @@ #ifndef Client_included #define Client_included +#include #include // for in_addr #include "Activity.h" diff -urN fam-oss-2.6.4/fam/FileSystem.c++ fam-oss-2.6.4-freebsd/fam/FileSystem.c++ --- fam-oss-2.6.4/fam/FileSystem.c++ Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/FileSystem.c++ Sat Mar 17 13:18:10 2001 @@ -22,7 +22,7 @@ #include "FileSystem.h" -#include +#include "mntent.h" #include #include "Event.h" diff -urN fam-oss-2.6.4/fam/FileSystemTable.c++ fam-oss-2.6.4-freebsd/fam/FileSystemTable.c++ --- fam-oss-2.6.4/fam/FileSystemTable.c++ Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/FileSystemTable.c++ Sat Mar 17 23:44:17 2001 @@ -21,9 +21,10 @@ // Temple Place - Suite 330, Boston MA 02111-1307, USA. #include +#include #include "FileSystemTable.h" -#include +#include "mntent.h" #include #include @@ -255,7 +256,10 @@ // create_fs_by_name initializes our "root" member variable. if (!fs_by_name) { create_fs_by_name(); +#if !defined(__FreeBSD__) + /* there is no mtab "file" in freebsd! */ mtab_watcher = new InternalClient(mtab_name, mtab_event_handler, NULL); +#endif } cr.become_user(); diff -urN fam-oss-2.6.4/fam/IMon.c++ fam-oss-2.6.4-freebsd/fam/IMon.c++ --- fam-oss-2.6.4/fam/IMon.c++ Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/IMon.c++ Sat Mar 17 14:06:17 2001 @@ -34,7 +34,9 @@ #endif #endif -#include +#if !defined(__FreeBSD__) +# include +#endif #include #include "Interest.h" diff -urN fam-oss-2.6.4/fam/Interest.c++ fam-oss-2.6.4-freebsd/fam/Interest.c++ --- fam-oss-2.6.4/fam/Interest.c++ Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/Interest.c++ Sat Mar 17 14:06:37 2001 @@ -25,7 +25,9 @@ #include #include #include -#include +#if !defined(__FreeBSD__) +# include +#endif #ifdef HAVE_IRIX_XTAB_VERIFICATION #include diff -urN fam-oss-2.6.4/fam/InternalClient.c++ fam-oss-2.6.4-freebsd/fam/InternalClient.c++ --- fam-oss-2.6.4/fam/InternalClient.c++ Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/InternalClient.c++ Sat Mar 17 23:20:15 2001 @@ -35,8 +35,8 @@ { assert(filename); assert(h); - assert(filename[0] == '/'); Log::debug("%s watching %s", name(), filename); + assert(filename[0] == '/'); interest = new File(filename, this, Request(0), Cred::SuperUser); } diff -urN fam-oss-2.6.4/fam/Listener.c++ fam-oss-2.6.4-freebsd/fam/Listener.c++ --- fam-oss-2.6.4/fam/Listener.c++ Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/Listener.c++ Sat Mar 17 14:12:57 2001 @@ -22,6 +22,8 @@ #include "Listener.h" +#include +#include #include #include #include @@ -202,7 +204,11 @@ // requested user and pass the name back to the client. char *tmpfile = tempnam("/tmp", ".fam"); +#if defined(__FreeBSD__) + sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" }; +#else sockaddr_un sun = { AF_UNIX, "" }; +#endif if(strlen(tmpfile) >= (sizeof(sun.sun_path) - 1)) { Log::error("tmpnam() too long for sun_path (%d >= %d)!", @@ -235,7 +241,7 @@ return; } - if (chown(sun.sun_path, uid, -1) != 0) + if (chown(sun.sun_path, uid, (gid_t)-1) != 0) { Log::perror("localclient chown"); close(client_sock); return; @@ -271,7 +277,11 @@ // Get the new socket. +#if defined(__FreeBSD__) + struct sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" }; +#else struct sockaddr_un sun = { AF_UNIX, "" }; +#endif CONFIG_SOCKLEN_T sunlen = sizeof(sun); int client_fd = accept(ofd, (struct sockaddr *) &sun, &sunlen); if (client_fd < 0) @@ -333,7 +343,11 @@ void Listener::dirty_ugly_hack() { +#if defined(__FreeBSD__) + static sockaddr_un sun = { sizeof (sockaddr_un), AF_UNIX, "/tmp/.fam_socket" }; +#else static sockaddr_un sun = { AF_UNIX, "/tmp/.fam_socket" }; +#endif int sock = socket(PF_UNIX, SOCK_STREAM, 0); if (sock < 0) diff -urN fam-oss-2.6.4/fam/Log.c++ fam-oss-2.6.4-freebsd/fam/Log.c++ --- fam-oss-2.6.4/fam/Log.c++ Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/Log.c++ Sat Mar 17 14:14:31 2001 @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include diff -urN fam-oss-2.6.4/fam/Makefile.am fam-oss-2.6.4-freebsd/fam/Makefile.am --- fam-oss-2.6.4/fam/Makefile.am Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/fam/Makefile.am Sat Mar 17 18:12:17 2001 @@ -72,6 +72,7 @@ main.c++ \ timeval.c++ \ timeval.h \ + mntent_compat.c++ \ @IMON_FUNCS@.c++ EXTRA_fam_SOURCES = IMonIrix.c++ IMonLinux.c++ IMonNone.c++ diff -urN fam-oss-2.6.4/fam/Scheduler.h fam-oss-2.6.4-freebsd/fam/Scheduler.h --- fam-oss-2.6.4/fam/Scheduler.h Sat May 20 05:46:32 2000 +++ fam-oss-2.6.4-freebsd/fam/Scheduler.h Sat Mar 17 00:14:04 2001 @@ -24,6 +24,7 @@ #define Scheduler_included #include +#include #include "Boolean.h" diff -urN fam-oss-2.6.4/fam/StringTable.h fam-oss-2.6.4-freebsd/fam/StringTable.h --- fam-oss-2.6.4/fam/StringTable.h Sat May 20 05:46:32 2000 +++ fam-oss-2.6.4-freebsd/fam/StringTable.h Sat Mar 17 18:05:38 2001 @@ -25,6 +25,7 @@ #include #include +#include "mntent.h" // A StringTable maps C strings onto values. It is a cheap O(n) // implementation, suitable only for small tables that are diff -urN fam-oss-2.6.4/fam/mntent.h fam-oss-2.6.4-freebsd/fam/mntent.h --- fam-oss-2.6.4/fam/mntent.h Thu Jan 1 01:00:00 1970 +++ fam-oss-2.6.4-freebsd/fam/mntent.h Sat Mar 17 18:11:08 2001 @@ -0,0 +1,56 @@ +/* + * mntent + * mntent.h - compatability header for FreeBSD + * + * Copyright (c) 2001 David Rufino + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(HAVE_MNTENT_H) +#include +#else +#ifndef _MNTENT_H +#define _MNTENT_H +#include + +#define MOUNTED "dummy" + +#define MNTTYPE_NFS "nfs" + +struct mntent { + char *mnt_fsname; + char *mnt_dir; + char *mnt_type; + char *mnt_opts; + int mnt_freq; + int mnt_passno; +}; + +#define setmntent(x,y) ((FILE *)0x1) +struct mntent *getmntent __P ((FILE *fp)); +char *hasmntopt __P ((const struct mntent *mnt, const char *option)); +#define endmntent(x) ((int)1) + +#endif /* _MNTENT_H */ +#endif /* HAVE_MNTENT_H */ diff -urN fam-oss-2.6.4/fam/mntent_compat.c++ fam-oss-2.6.4-freebsd/fam/mntent_compat.c++ --- fam-oss-2.6.4/fam/mntent_compat.c++ Thu Jan 1 01:00:00 1970 +++ fam-oss-2.6.4-freebsd/fam/mntent_compat.c++ Sat Mar 17 23:48:07 2001 @@ -0,0 +1,151 @@ +/* + * Copyright (c) 1980, 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 2001 + * David Rufino + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* most of this was ripped from the mount(3) source */ + +#include "config.h" +#include "mntent.h" +#if !defined(HAVE_MNTENT_H) +#include +#include +#include +#include +#include + +static int pos = -1; +static int mntsize = -1; +static struct mntent _mntent; + +char * +hasmntopt (const struct mntent *mnt, const char *option) +{ + int found; + char *opt, *optbuf; + + optbuf = strdup(mnt->mnt_opts); + found = 0; + for (opt = optbuf; (opt = strtok(opt, " ")) != NULL; opt = NULL) { + if (!strcasecmp(opt, option)) { + opt = opt - optbuf + mnt->mnt_opts; + free (optbuf); + return (opt); + } + } + free (optbuf); + return (NULL); +} + +static char * +catopt (char *s0, const char *s1) +{ + size_t i; + char *cp; + + if (s1 == NULL || *s1 == '\0') + return s0; + if (s0 && *s0) { + i = strlen(s0) + strlen(s1) + 1 + 1; + if ((cp = (char *)malloc(i)) == NULL) + return (NULL); + (void)snprintf(cp, i, "%s %s", s0, s1); + } else + cp = strdup(s1); + + if (s0) + free(s0); + return (cp); +} + + +static char * +flags2opts (int flags) +{ + char *res; + res = NULL; + res = catopt(res, (flags & MNT_RDONLY) ? "ro" : "rw"); + if (flags & MNT_SYNCHRONOUS) res = catopt(res, "sync"); + if (flags & MNT_NOEXEC) res = catopt(res, "noexec"); + if (flags & MNT_NOSUID) res = catopt(res, "nosuid"); + if (flags & MNT_NODEV) res = catopt(res, "nodev"); + if (flags & MNT_UNION) res = catopt(res, "union"); + if (flags & MNT_ASYNC) res = catopt(res, "async"); + if (flags & MNT_NOATIME) res = catopt(res, "noatime"); + if (flags & MNT_NOCLUSTERR) res = catopt(res, "noclusterr"); + if (flags & MNT_NOCLUSTERW) res = catopt(res, "noclusterw"); + if (flags & MNT_NOSYMFOLLOW) res = catopt(res, "nosymfollow"); + if (flags & MNT_SUIDDIR) res = catopt(res, "suiddir"); + + return res; +} + +static struct mntent * +statfs_to_mntent (struct statfs *mntbuf) +{ + static char opts_buf[40], *tmp; + + _mntent.mnt_fsname = mntbuf->f_mntfromname; + _mntent.mnt_dir = mntbuf->f_mntonname; + _mntent.mnt_type = mntbuf->f_fstypename; + tmp = flags2opts (mntbuf->f_flags); + if (tmp) { + opts_buf[sizeof(opts_buf)-1] = '\0'; + strncpy (opts_buf, tmp, sizeof(opts_buf)-1); + free (tmp); + } else { + *opts_buf = '\0'; + } + _mntent.mnt_opts = opts_buf; + _mntent.mnt_freq = _mntent.mnt_passno = 0; + return (&_mntent); +} + +struct mntent * +getmntent (FILE *fp) +{ + struct statfs *mntbuf; + + if (pos == -1 || mntsize == -1) + mntsize = getmntinfo (&mntbuf, MNT_NOWAIT); + + ++pos; + if (pos == mntsize) { + pos = mntsize = -1; + return (NULL); + } + + return (statfs_to_mntent (&mntbuf[pos])); +} + +#endif /* HAVE_MNTENT_H */ diff -urN fam-oss-2.6.4/libfam/Client.c++ fam-oss-2.6.4-freebsd/libfam/Client.c++ --- fam-oss-2.6.4/libfam/Client.c++ Sat May 20 05:46:32 2000 +++ fam-oss-2.6.4-freebsd/libfam/Client.c++ Sat Mar 17 00:12:01 2001 @@ -20,6 +20,7 @@ // with this program; if not, write the Free Software Foundation, Inc., 59 // Temple Place - Suite 330, Boston MA 02111-1307, USA. +#include #include #include #include diff -urN fam-oss-2.6.4/libfam/fam.c++ fam-oss-2.6.4-freebsd/libfam/fam.c++ --- fam-oss-2.6.4/libfam/fam.c++ Sat May 20 05:46:32 2000 +++ fam-oss-2.6.4-freebsd/libfam/fam.c++ Sat Mar 17 00:12:43 2001 @@ -21,6 +21,7 @@ // Temple Place - Suite 330, Boston MA 02111-1307, USA. #include +#include #include #include #include diff -urN fam-oss-2.6.4/test/test.c++ fam-oss-2.6.4-freebsd/test/test.c++ --- fam-oss-2.6.4/test/test.c++ Sat May 20 05:46:32 2000 +++ fam-oss-2.6.4-freebsd/test/test.c++ Sat Mar 17 18:39:23 2001 @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include --- fam-oss-2.6.4/acconfig.h Sat May 20 05:46:31 2000 +++ fam-oss-2.6.4-freebsd/acconfig.h Sun Mar 18 00:40:47 2001 @@ -44,6 +44,8 @@ ** Otherwise, we'll use MNTTYPE_NFS. */ #undef HAVE_FSID_NFS2 +#undef HAVE_MNTENT_H + /* Define if we have MNTTYPE_NFS2 */ #define HAVE_MNTTYPE_NFS2 0 --17pEHd4RhPHOinZp-- -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Mon Mar 26 11:59:16 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f2QJxGd02049 for fam-outgoing; Mon, 26 Mar 2001 11:59:16 -0800 Received: from sgi.com (sgi.SGI.COM [192.48.153.1]) by oss.sgi.com (8.11.3/8.11.3) with ESMTP id f2QJxFM02044 for ; Mon, 26 Mar 2001 11:59:15 -0800 Received: from rlyeh.engr.sgi.com ([198.29.76.98]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id LAA02396 for ; Mon, 26 Mar 2001 11:59:10 -0800 (PST) mail_from (rusty@rlyeh.engr.sgi.com) Received: (from rusty@localhost) by rlyeh.engr.sgi.com (SGI-8.9.3/8.9.3) id LAA14805; Mon, 26 Mar 2001 11:54:54 -0800 (PST) From: "Rusty Ballinger" Message-Id: <10103261154.ZM21278@rlyeh.engr.sgi.com> Date: Mon, 26 Mar 2001 11:54:54 -0800 In-Reply-To: Jeremy Norris "[fam] Patches to make Fam run on FreeBSD" (Mar 19, 8:40pm) References: <20010319204027.A3215@babylon.merseine.nu> X-Face: #)4}U4e`O6YEe%oBzE}>ycmT!Xt?Myiqo~|p3Wh'UuQ[N7)&4\4?8:1n)bmPX]b@#k94%!VojpODdmk:sCr1b\-aXD&P:wjBqupMB:ag6}BwVseJZM@K{$E|0J9}&,Rpdg{&N4/Y8&PTm6>|r[,gI2T*qN!`AZhl>Bdy7JR`dDvP(/pz.}?Q@dg':mlV`RX51Z_ZG?Gta|Q!iA[MaOh Reply-To: rusty@sgi.com X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail) To: ishmael27@home.com Subject: Re: [fam] Patches to make Fam run on FreeBSD Cc: fam@oss.sgi.com, daverufino@btinternet.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-fam@oss.sgi.com Precedence: bulk > The other day I was presented with the following patches from David Rufion > , which make Fam compile and successfully run > under FreeBSD. Thanks, I'll put this in the download area & update the "news" page. A few questions, though: - I'd like to add a bit at the top about the exact patch command to run. Just to make sure, "cd fam-oss-2.6.4 ; patch -p 1 < this_patch" works on FreeBSD? - Actually, I'd prefer to integrate the patch into fam so that people don't have to do that on FreeBSD, but the legal requirements in mntent_compat.c make me nervous. There's no unencumbered or GPL version available? If getmntent() just parses /etc/mtab or whatever & stuffs its entries into structs, could a version be copied from glibc/linux/wherever? - Does FreeBSD uses some software installation database (like inst on IRIX, rpm or dpkg on Linux, etc.)? If you have a patch for building installable images, I'll take it... :) - This patch doesn't appear to use FMON. (Is that correct? Using this patch, fam will always poll on FreeBSD?) There's a note at http://oss.sgi.com/projects/fam/news.html about using FMON (and a link to the FMON web page), but what it says there is all I know about it. If any user process can make multiple requests to FMON, then you could patch libfam's FAMOpen() etc. to call fmon_open(), and each client would talk to FMON through libfam, instead of talking to fam. This would be much better than having fam poll, if it works, and if it's a "standard" FreeBSD thing, etc. (Actually, if you could do that, we could do away with all the mntent_compat stuff, since you wouldn't need to build fam itself on FreeBSD.) --Rusty -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Mon Mar 26 12:27:18 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f2QKRIY02657 for fam-outgoing; Mon, 26 Mar 2001 12:27:18 -0800 Received: from c007.snv.cp.net (c007-h005.c007.snv.cp.net [209.228.33.211]) by oss.sgi.com (8.11.3/8.11.3) with SMTP id f2QKRIM02654 for ; Mon, 26 Mar 2001 12:27:18 -0800 Received: (cpmta 1420 invoked from network); 26 Mar 2001 12:27:10 -0800 Date: 26 Mar 2001 12:27:10 -0800 Message-ID: <20010326202710.1419.cpmta@c007.snv.cp.net> X-Sent: 26 Mar 2001 20:27:10 GMT Received: from [208.62.74.202] by mail.telocity.com with HTTP; 26 Mar 2001 12:27:09 PST Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 To: fam@oss.sgi.com From: Chap Lovejoy X-Mailer: Web Mail 3.9.0.19 Subject: Re: [fam] Patches to make Fam run on FreeBSD Sender: owner-fam@oss.sgi.com Precedence: bulk Regarding FMON on FreeBSD: Back in June I was investigating porting FAM to FreeBSD using the FMON mechanisims. After chasing several dead end leads, I contacted someone who had worked on the original FMON functionality for FreeBSD. He indicated that the work was done on a very old version of the kernel (which has been modified heavily since) and was never integrated into the core source. He also was unable to find a copy of the source for FMON and expressed concern over the patent for the same technology held by SGI. Unfortunately, at this point school pressures made it impossible for me to continue looking into this. If anyone is interested in following up on the FMON functionality, I believe I still have that information hanging around somewhere. Chap On Mon, 26 March 2001, "Rusty Ballinger" wrote: > - This patch doesn't appear to use FMON. (Is that correct? Using this > patch, fam will always poll on FreeBSD?) There's a note at > http://oss.sgi.com/projects/fam/news.html about using FMON (and a link to > the FMON web page), but what it says there is all I know about it. -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Tue Mar 27 18:45:51 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f2S2jpX22773 for fam-outgoing; Tue, 27 Mar 2001 18:45:51 -0800 Received: from web12508.mail.yahoo.com (web12508.mail.yahoo.com [216.136.173.200]) by oss.sgi.com (8.11.3/8.11.3) with SMTP id f2S2jpM22770 for ; Tue, 27 Mar 2001 18:45:51 -0800 Message-ID: <20010328024546.66993.qmail@web12508.mail.yahoo.com> Received: from [209.136.229.146] by web12508.mail.yahoo.com; Tue, 27 Mar 2001 18:45:46 PST Date: Tue, 27 Mar 2001 18:45:46 -0800 (PST) From: Super User To: fam@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-fam@oss.sgi.com Precedence: bulk Hello, my name is Chris (just thought i'd introduce myself) and i am having much trouble compiling imon support into my kernel so i was wondering: 1) Can i get some help with it. 2) How do i get fam to compile without imon support. 3) Can someone send me a precompiled version of it Thanks --Chris btw, i am running RH7 linux on a laptop, and have tried compiling with all supported kernels... __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com From owner-fam@oss.sgi.com Wed Mar 28 07:25:19 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f2SFPJx06141 for fam-outgoing; Wed, 28 Mar 2001 07:25:19 -0800 Received: from carbon.btinternet.com (carbon.btinternet.com [194.73.73.92]) by oss.sgi.com (8.11.3/8.11.3) with ESMTP id f2SFPHM06138 for ; Wed, 28 Mar 2001 07:25:18 -0800 Received: from host213-1-148-182.btinternet.com ([213.1.148.182] helo=mail.btinternet.com) by carbon.btinternet.com with smtp (Exim 3.03 #83) id 14iHot-0002UB-00 for fam@oss.sgi.com; Wed, 28 Mar 2001 16:25:11 +0100 Date: Tue, 27 Mar 2001 21:09:00 +0100 From: David Rufino To: rusty@sgi.com Subject: Re: [fam] Patches to make Fam run on FreeBSD Message-ID: <20010327210900.A647@btinternet.com> References: <20010319204027.A3215@babylon.merseine.nu> <10103261154.ZM21278@rlyeh.engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <10103261154.ZM21278@rlyeh.engr.sgi.com>; from rusty@rlyeh.engr.sgi.com on Mon, Mar 26, 2001 at 11:54:54AM -0800 Sender: owner-fam@oss.sgi.com Precedence: bulk * Rusty Ballinger (rusty@rlyeh.engr.sgi.com) wrote: > Thanks, I'll put this in the download area & update the "news" page. A few > questions, though: > > - I'd like to add a bit at the top about the exact patch command to run. > Just to make sure, "cd fam-oss-2.6.4 ; patch -p 1 < this_patch" works > on FreeBSD? I use just patch -p0 < fam-oss-2.6.4.patch. > - Actually, I'd prefer to integrate the patch into fam so that people don't > have to do that on FreeBSD, but the legal requirements in mntent_compat.c > make me nervous. There's no unencumbered or GPL version available? If > getmntent() just parses /etc/mtab or whatever & stuffs its entries into > structs, could a version be copied from glibc/linux/wherever? I'm not sure but I think, in a source distribution, simply retaining the header is sufficient to satisfy the BSD license. > - This patch doesn't appear to use FMON. (Is that correct? Using this > patch, fam will always poll on FreeBSD?) There's a note at > http://oss.sgi.com/projects/fam/news.html about using FMON (and a link to > the FMON web page), but what it says there is all I know about it. > > If any user process can make multiple requests to FMON, then you could patch > libfam's FAMOpen() etc. to call fmon_open(), and each client would talk to > FMON through libfam, instead of talking to fam. This would be much better > than having fam poll, if it works, and if it's a "standard" FreeBSD thing, > etc. (Actually, if you could do that, we could do away with all the > mntent_compat stuff, since you wouldn't need to build fam itself on FreeBSD.) As Chap Lovejoy indicated, FMON isn't in stable. The only way to monitor files is to use the kqueue/kevent facility, which I plan to incorporate into fam. Adding this to libfam itself would be possible but would require some FreeBSD specific hooks to allow the user process to monitor different events in the same thread. It's also problematic since at the moment it's only possible to monitor files on the UFS filesystem (though I expect this will change). And fam has the advantage of being able to communicate with remote fam servers. So to start I'll just write a patch for fam to use kqueue and perhaps extend it to allow libfam to monitor UFS files, directly, as a special case. > --Rusty Regards, David -- Source code, list archive, and docs: http://oss.sgi.com/projects/fam/ To unsubscribe: echo unsubscribe fam | mail majordomo@oss.sgi.com