From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 23 20:38:15 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 184CB1065675 for ; Sat, 23 Aug 2008 20:38:15 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by mx1.freebsd.org (Postfix) with ESMTP id C28CB8FC13 for ; Sat, 23 Aug 2008 20:38:14 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so494246yxb.13 for ; Sat, 23 Aug 2008 13:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Bc7J0nI90cR/pOkgO2FrNcRtF359kC0gYLPOK7dO9Us=; b=Y/Wvn1NHQTWTfGXU1Q8ZA9MvzEBSUIlF6khGfZDafS06UuBuqvuhGi0V0XvdjJwacK ehFaa3sjuEzxl1KVaQgZAFf3zHWJUAYS6rUVmxhymoGuymdyEKFlGhoLLkCFjwTN2Rwu aDfeBmKDy0pjg90GjvAjwNpv36S0D5FZIdGU0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=qaRmP+mrfTyxEUr8owbArgfConOvxnDrsL3/x4JzlwVmmn9V0a7l7pw1+ucPgu6ixC j/o1E3vbdfAbqOUAxHy4E+tHaXlz6ghujgf9R8r0aUSfaNpR8kSeNB78YCwxy63FRQMW FmJa1Veg8N8PLkyhFKoD7hKhgTGqGw4JqRO6g= Received: by 10.150.152.17 with SMTP id z17mr4191965ybd.235.1219523893635; Sat, 23 Aug 2008 13:38:13 -0700 (PDT) Received: by 10.150.144.6 with HTTP; Sat, 23 Aug 2008 13:38:13 -0700 (PDT) Message-ID: Date: Sat, 23 Aug 2008 16:38:13 -0400 From: "Aryeh Friedman" To: gary.jennejohn@freenet.de In-Reply-To: <20080823153354.2ed632d4@peedub.jennejohn.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080823153354.2ed632d4@peedub.jennejohn.org> Cc: freebsd-hackers@freebsd.org Subject: Re: What is difference between /etc/rc called programs and ones called after login prompt shows up X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Aug 2008 20:38:15 -0000 On Sat, Aug 23, 2008 at 8:27 AM, Garrett Cooper wrote: > On Sat, Aug 23, 2008 at 3:34 AM, Aryeh Friedman > wrote: >> What is difference between /etc/rc.d called programs and ones called >> after login prompt shows up? >> >> The reason for asking is sysutils/fusefs-kmod gives an error if any >> mounts are attempted in /etc/rc but if the exactly the same command is >> issued by a user's .login/.xsession/etc. it works without problem >> (assuming proper permissions of course). >> >> a) Can anyone think of a reason why this would happen (the maintainer >> is non-responive) >> b) Is it possible to force something to run after /etc/rc exits but >> before init calls getty? > > a) Bad credentials? Dependencies not started (yet)? > b) You can enforce ordering, if that's what you want. See: > http://www.freebsd.org/doc/en/articles/rc-scripting/ a) I use a custom /etc/rc thus I can place the mount command anywhere I want. No matter where I place I get the same error it is *ONLY* after /etc/rc terminates.... I am b) I load fuse.ko in /boot/loader.con (copied it from /usr/local/modules to /boot/modules) here is dmesg proof it is loaded: > dmesg|grep fuse fuse4bsd: version 0.3.9-pre1, FUSE ABI 7.8 fuse4bsd: compiled against kernel config /usr/obj/usr/src/sys/MONSTER c) See a additionally to prove all the above here is my /etc/rc (the last 2 lines where added just to prove the point): #!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin swapon -a fsck -p mount -rw / mount -a hostname flosoft.no-ip.biz ifconfig re0 192.168.2.2 ifconfig lo0 127.0.0.1 route add default 192.168.2.1 named cupsd noip2 ntpdate pool.ntp.org sendmail -bd -q1m apachectl start moused -t auto -p /dev/ums0 vidcontrol -m on mount /mnt/win_c mount /mnt/win_d Here is /etc/fstab (set up as recommended in the docs for sysutils/fusefs-ntfs [which I am the co-maintainer of]): # Device Mountpoint FStype Options Dump Pass# /dev/ad8s2b none swap sw 0 0 /dev/ad8s2a / ufs rw 1 1 /dev/ad8s2e /tmp ufs rw 2 2 /dev/ad8s2f /usr ufs rw 2 2 /dev/ad8s2d /var ufs rw 2 2 /dev/acd0 /cdrom cd9660 ro,noauto 0 0 proc /proc procfs rw 0 0 linproc /compat/linux/proc linprocfs rw 0 0 /dev/ad8s1 /mnt/win_c ntfs-3g rw,late 0 0 /dev/da0s1 /mnt/win_d ntfs-3g rw,late 0 0 The patch to mount recommended in the fusefs-ntfs docs has been applied. In order to show that the mount commands work post call to getty but not before: When the above /etc/rc is run: swapon: adding /dev/ad8s2b as swap device /dev/ad8s2a: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad8s2a: clean, 164555 free (3603 frags, 20119 blocks, 1.4% fragmentation) /dev/ad8s2e: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad8s2e: clean, 253254 free (54 frags, 31650 blocks, 0.0% fragmentation) /dev/ad8s2f: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad8s2f: clean, 210848941 free (53253 frags, 26349461 blocks, 0.0% fragmenta tion) /dev/ad8s2d: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ad8s2d: clean, 1970559 free (551 frags, 246251 blocks, 0.0% fragmentation) re0: link state changed to DOWN add net default: gateway 192.168.2.1 re0: link state changed to UP 23 Aug 09:02:00 ntpdate[48]: step time server 216.184.20.83 offset 0.794898 sec pid 54 (limits), uid 0: exited on signal 11 (core dumped) [Sat Aug 23 09:02:01 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter fuse: failed to exec mount program: No such file or directory fuse: failed to mount file system: Unknown error: 0 fuse: failed to exec mount program: No such file or directory fuse: failed to mount file system: Unknown error: 0 FreeBSD/i386 (flosoft.no-ip.biz) (ttyv0) login: Here is the .login for root and the .xsession for my main user account (I use xdm): > more ~root/.login # $FreeBSD: src/etc/root/dot.login,v 1.22 2000/07/15 03:25:14 rwatson Exp $ # # .login - csh login script, read by login shell, after `.cshrc' at login. # # see also csh(1), environ(7). # # Uncomment to display a random cookie each login: # [ -x /usr/games/fortune ] && /usr/games/fortune -s echo Mounting C: mount /mnt/win_c echo Mounting D: mount /mnt/win_d > more ~aryeh/.xsession sudo mount /mnt/win_c& sudo mount /mnt/win_d& mixer 100 mixer pcm 100 xfce4-session Sudo is configured to allow 'aryeh' to no password access. And finally proof that the two methods do in fact work: > df -k Filesystem 1024-blocks Used Avail Capacity Mounted on /dev/ad8s2a 507630 178520 288500 38% / devfs 1 1 0 100% /dev /dev/ad8s2e 507630 1124 465896 0% /tmp /dev/ad8s2f 443581998 21884342 386211098 5% /usr /dev/ad8s2d 4040654 99570 3617832 3% /var procfs 4 4 0 100% /proc linprocfs 4 4 0 100% /usr/compat/linux/proc /dev/fuse0 20972824 20196712 776112 96% /mnt/win_c /dev/fuse1 244196348 2463792 241732556 1% /mnt/win_d Thus it is clear that the *ONLY* difference between the /etc/rc calls and the post getty calls is when they are made. Thus the orginal question (i.e. I have verified this happens on any fusefs-* file system). I have attempted to call stuff via alternate methods like such as calling the mount_* directly and using equiv programs that have different names for each fusefs-* and did so with and without having the enteries in /etc/fstab > > -Garrett >