Re: ext2 drives under 5.3 not umounting on reboots

2005-04-18 Thread Andriy Tkachuk
I've had the same problem on 5.3.
now on my FreeBSD 5.4-RC2 #0: Fri Apr 15 11:28:48 EEST 2005 i386
it seems that problem gone.

On Sunday 17 April 2005 00:07, c0ldbyte wrote:
> On Sat, 16 Apr 2005, M. Parsons wrote:
> 
> > I have a ext2 linux partition mounted under /linux via the fstab line:
> >
> > /dev/ad2s1 /linux  ext2fs  rw  1   2
> >
> > It will automount on bootup, but if I do a reboot or shutdown -h now, it
> > doesnt get umounted properly.  In fact, if this /linux is mounted, then /,
> > /usr, /var, and /tmp (all seperate ufs slices on another hard drive) also 
> > get
> > tainted during a reboot.  And on the next startup I get the good ole:
> > WARNING: /usr was not properly dismounted, leaving me to fsck the drives in
> > single mode (which sucks, as the fbsd machine is a headless NAT machine).
> > Running fsck in single mode does fix everything.
> >
> > So whats going on here?  reboot aint properly umounting partitions, and fsck
> > doesnt seem to be properly running during bootup if it detects tainted
> > filesystems.
> >
> > Any ideas?
> >
> > Freebsd 5.3 SMP kernel.
> 
> Try this line:
> /dev/ad2s1 /linux  ext2fs  rw  0   0
> 
> But remember the ext2 code has been buggy for a while and is not allways
> a good choice to try and do writes on it. Might be a better choice to
> change rw to ro and to also check that drive/partition for errors with
> its original fsck to fix any errors if there is any then it will most
> likely mount properly and umount properly.
> 
> Best of luck,
>   --c0ldbyte
> 
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


sigprocmask and fork

2005-04-18 Thread Kostik Belousov
Hi, 

I come across the following problem:
after fork(), the 5-STABLE system sets the child process
blocked signal mask to 0 (let us account single-threaded processes only).   
I was under impression that signal mask 
shall be inherited by the child process (according to SUSv3 and 
man fork). Inheritance _was_ the behaviour of 4-STABLE (there, p_sigmask
belongs to struct proc and placed in the copied-on-fork part
of the structure) and also seen on other UNIXes (e.g. Solaris).

After googling, I found the comment by Dong Xuezhang in
http://lists.freebsd.org/pipermail/freebsd-threads/2005-February/002899.html
where he said that "Actually fork() do not copy the properties of signal mask". 

I confirm that fork does not copy mask, but why ? Attached is the program that  
illustrates this issue on   
pooma% uname -a  ~/work/bsd/sigmask 
FreeBSD pooma.home 5.4-STABLE FreeBSD 5.4-STABLE #32: Fri Apr 15 22:16:43 EEST 
2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/POOMA  i386
On unpatched 5-STABLE, the child process reports SIGUSR2 immediately after
start, despite parent blocked SIGUSR2 before forking.

It seems that needs of thread_schedule_upcall() to zero sigmask interfere
with the needs of the fork1().
I propose the trivial patch (against 5-STABLE) to fix the problems. It handles
td_sigmask in the way similar to td_sigstk, that is also zeroed on _upcall(),
as was done by davidxu at kern/kern_fork.c:1.209 rev.


Index: kern/kern_fork.c
===
RCS file: /usr/local/arch/ncvs/src/sys/kern/kern_fork.c,v
retrieving revision 1.234.2.8
diff -U5 -r1.234.2.8 kern_fork.c
--- kern/kern_fork.c27 Feb 2005 02:36:39 -  1.234.2.8
+++ kern/kern_fork.c18 Apr 2005 08:58:50 -
@@ -470,10 +470,11 @@
__rangeof(struct thread, td_startcopy, td_endcopy));
bcopy(&td->td_ksegrp->kg_startcopy, &kg2->kg_startcopy,
__rangeof(struct ksegrp, kg_startcopy, kg_endcopy));

td2->td_sigstk = td->td_sigstk;
+   td2->td_sigmask = td->td_sigmask;

/*
 * Duplicate sub-structures as needed.
 * Increase reference counts on shared objects.
 */


Thanks for attention,   
Kostik Belousov.


#include 
#include 
#include 
#include 
#include 
#include 

extern "C" void
sigusr2_handler(int signo)
{
static const char msg[] = "SIGUSR2\n";
write(2, msg, sizeof(msg) - 1);
_exit(0);
}

int
main(int argc, char *argv[])
{
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = sigusr2_handler;
sigaction(SIGUSR2, &sa, NULL);

sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGUSR2);
sigprocmask(SIG_BLOCK, &mask, NULL);

pid_t child = fork();
if (child == 0)
{
raise(SIGUSR2);
printf("sleeping\n");
sleep(10);
printf("enabling SIGUSR2\n");
sigprocmask(SIG_UNBLOCK, &mask, NULL);
while (true)
;
}

int status;
wait(&status);
return 0;
}
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: NFS client/buffer cache deadlock

2005-04-18 Thread Marc Olzheim
On Fri, Apr 15, 2005 at 11:07:08AM -0400, Brian Fundakowski Feldman wrote:
> > Is this supposed to fix kern/79208 ?
> 
> Yes, it does; would you like to try a more recent version of the patch?
> It's actually against -STABLE, but it needs to be tested in -CURRENT if
> it's going ot try to make it into 5.x (or hopefully 5.4-RELEASE).
> 
> See: 

Ok, I'll try it out on -CURRENT then.

Marc


pgpAntn3YlXQZ.pgp
Description: PGP signature


Re: ext2 drives under 5.3 not umounting on reboots

2005-04-18 Thread c0ldbyte
On Mon, 18 Apr 2005, Andriy Tkachuk wrote:
I've had the same problem on 5.3.
now on my FreeBSD 5.4-RC2 #0: Fri Apr 15 11:28:48 EEST 2005 i386
it seems that problem gone.
I would advise once more changing the "Dump" & "Pass#" number fields
to "0" for both as I showed on the line below, you would have found
out that was causing if any most of your problem with your filesystems
being mounted/unmounted properly.
On Sunday 17 April 2005 00:07, c0ldbyte wrote:
On Sat, 16 Apr 2005, M. Parsons wrote:
I have a ext2 linux partition mounted under /linux via the fstab line:
/dev/ad2s1 /linux  ext2fs  rw  1   2
It will automount on bootup, but if I do a reboot or shutdown -h now, it
doesnt get umounted properly.  In fact, if this /linux is mounted, then /,
/usr, /var, and /tmp (all seperate ufs slices on another hard drive) also get
tainted during a reboot.  And on the next startup I get the good ole:
WARNING: /usr was not properly dismounted, leaving me to fsck the drives in
single mode (which sucks, as the fbsd machine is a headless NAT machine).
Running fsck in single mode does fix everything.
So whats going on here?  reboot aint properly umounting partitions, and fsck
doesnt seem to be properly running during bootup if it detects tainted
filesystems.
Any ideas?
Freebsd 5.3 SMP kernel.
Try this line:
/dev/ad2s1 /linux  ext2fs  rw  0   0
But remember the ext2 code has been buggy for a while and is not allways
a good choice to try and do writes on it. Might be a better choice to
change rw to ro and to also check that drive/partition for errors with
its original fsck to fix any errors if there is any then it will most
likely mount properly and umount properly.
Best of luck,
--c0ldbyte

--
( When in doubt, use brute force. -- Ken Thompson 1998 )
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Making multiple jails

2005-04-18 Thread Franklin Chef(news)
Matt wrote:
I'd like to create five jails on one machine.  Is it possible to make 
them all at the same time?  I'm only familiary with creating them 
individually (DESTDIR=/foo/bar).  Thanks much.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to 
"[EMAIL PROTECTED]"

No problem, you can run multiple jail at the same time. All you have to 
do is to create different jail directories and edit rc.conf like this:

jail_enable="YES"
jail_list="jail1 jail2 jail3"
jail_jail1_hostname="jail1.jail.org"
jail_jail1_ip="192.168.4.100"
...
jail_jail2_hostname="jail2.jail.org"
jail_jail2_ip="192.168.4.101"
...
jail_jail3_hostname="jail3.jail.org"
jail_jail3_ip="192.168.4.102"
...
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Making multiple jails

2005-04-18 Thread c0ldbyte
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Sun, 17 Apr 2005, Franklin Chef(news) wrote:
Matt wrote:
I'd like to create five jails on one machine.  Is it possible to make them 
all at the same time?  I'm only familiary with creating them individually 
(DESTDIR=/foo/bar).  Thanks much.

No problem, you can run multiple jail at the same time. All you have to do is 
to create different jail directories and edit rc.conf like this:

jail_enable="YES"
jail_list="jail1 jail2 jail3"
jail_jail1_hostname="jail1.jail.org"
jail_jail1_ip="192.168.4.100"

jail_jail2_hostname="jail2.jail.org"
jail_jail2_ip="192.168.4.101"

jail_jail3_hostname="jail3.jail.org"
jail_jail3_ip="192.168.4.102"


I believe he is asking if it is possible to create them at the same time
not really run them at the same time. But that is good information for
him to know as well anyhow. But the only way to go about that is to do
the (make world DESTDIR=/path/to/jail#) for each jail that you need. Now
after the first initial build of world, if you didnt do a (make clean)
then you should beable to just (make installworld DESTDIR=/path/to/jail#)
and the new jail will apear there with the specified parameters that you
fed DESTDIR.
Hope this all helped you on your quest for knowledge.
--c0ldbyte
- -- 
( When in doubt, use brute force. -- Ken Thompson 1998 )
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (FreeBSD)
Comment: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF7DF979F
Comment: Fingerprint = D1DC 0AA4 1C4E EAD4 24EB  7E77 B261 50BA F7DF 979F

iD8DBQFCY68RsmFQuvffl58RAhnMAJ93XIg2Aw/NMxq0x6x4DJ+IGHTN0gCfYoJP
EhVUzcXW/x6mDksaTVLE5Mg=
=VpNt
-END PGP SIGNATURE-
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Making multiple jails

2005-04-18 Thread [EMAIL PROTECTED]
On Mon, 18 Apr 2005 08:58:54 -0400 (EDT)
c0ldbyte <[EMAIL PROTECTED]> wrote:

> I believe he is asking if it is possible to create them at the same
> time not really run them at the same time. But that is good
> information for him to know as well anyhow. But the only way to go
> about that is to do the (make world DESTDIR=/path/to/jail#) for each
> jail that you need. Now after the first initial build of world, if you
> didnt do a (make clean) then you should beable to just (make
> installworld DESTDIR=/path/to/jail#) and the new jail will apear there
> with the specified parameters that you fed DESTDIR.

the only way ? i thought UNIX-alikes were known for having always more
than one way ;-)

another option is to use cpdup to duplicate a fresh jail

also quite interesting imho is this :

http://www.the-labs.com/FreeBSD/JailTools/fbsd_jails.html

this webmin-module offers "light-jails", read-only /usr mount, and
also jails installed in a single file

if you have that file you can easily reproduce new jails with a simple
cp-command

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


5.4-RC2 keyboard problem on Dell PowerEdge 2850

2005-04-18 Thread Sławek Żak
Hi,

After install from CD the keyboard doesn't work on this machine. Has
anyone else seen it?

/S
-- 
Sławek Żak / UNIX Systems Administrator
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: ext2 drives under 5.3 not umounting on reboots

2005-04-18 Thread ALeine
[EMAIL PROTECTED] wrote: 

> I've had the same problem on 5.3.
> now on my FreeBSD 5.4-RC2 #0: Fri Apr 15 11:28:48 EEST 2005 i386
> it seems that problem gone.
> 
> On Sunday 17 April 2005 00:07, c0ldbyte wrote:
> > On Sat, 16 Apr 2005, M. Parsons wrote:
> > 
> > > I have a ext2 linux partition mounted under /linux via the
> > > fstab line:
> > >
> > > /dev/ad2s1 /linux  ext2fs  rw  1 2
> > >
> > > It will automount on bootup, but if I do a reboot or shutdown
> > > -h now, it doesnt get umounted properly.  In fact, if this /linux
> > > is mounted, then /, /usr, /var, and /tmp (all seperate ufs slices
> > > on another hard drive) also get tainted during a reboot.

A couple of weeks ago I saw what I believe to be the same problem, but
on 4.10-STABLE. My attempt to umount an ext2 volume resulted in failure
with the "unknown mount type" error message. I then resorted to using
umount -t ext2fs /linux and the volume was unmounted properly,
so as a workaround you could specify umount -t ext2fs explicitly
in rc.shutdown or similar.

I checked the sources in an attempt to find the cause and here is what
I found out:

In src/sbin/umount.c:

RELENG_5:
In umountall():
   /* Ignore unknown file system types. */
   if (getvfsbyname(fs->fs_vfstype, &vfc) == -1)
   continue;
   if (checkvfsname(fs->fs_vfstype, typelist))
   continue;
   ...
   rval = umountall(typelist);
   rval = checkname(cp, typelist) || rval;
   free(cp);
   return (rval);
} while ((fs = getfsent()) != NULL);
return (0);
}

In checkname():
if (sfs == NULL) {
warnx("%s: unknown file system", name);
return (1);
}
if (checkvfsname(sfs->f_fstypename, typelist))
return (1);
return (umountfs(sfs));
}

RELENG4:
In umountall():
/* If an unknown file system type, complain. */
if (getvfsbyname(fs->fs_vfstype, &vfc) == -1) {
warnx("%s: unknown mount type", fs->fs_vfstype);
continue;
}
if (checkvfsname(fs->fs_vfstype, typelist))
continue;
...
rval = umountall(typelist);
rval = umountfs(cp, typelist) || rval;
free(cp);
return (rval);
} while ((fs = getfsent()) != NULL);
return (0);
}

As you can see, the RELENG_5 code was changed to call a separate
function named checkname() instead of checking and reporting name
problems directly, but in that process a new check is introduced
in a way that makes it possible for umount(8) to fail without
reporting the reason for failure.

Neither getvfsbyname(3) in src/lib/libc/gen/getvfsbyname.c nor
checkvfsname() in src/sbin/mount/vfslist.c have changed in
significant ways that would indicate they could be at fault,
however there might be a problem with keeping track of filesystem
modules, specifically, fs_vfstype (struct fstab) on RELENG_{4,5}
and/or f_fstypename (struct statfs) on RELENG_5. Any clues?

ALeine
___
WebMail FREE http://mail.austrosearch.net 
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: 5.4-RC2 keyboard problem on Dell PowerEdge 2850

2005-04-18 Thread c0ldbyte
On Mon, 18 Apr 2005, [ISO-8859-2] S³awek ¯ak wrote:
Hi,
After install from CD the keyboard doesn't work on this machine. Has
anyone else seen it?
/S
Select the correct key map screen map etc... ?
--
( When in doubt, use brute force. -- Ken Thompson 1998 )___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: 5.4-RC2 keyboard problem on Dell PowerEdge 2850

2005-04-18 Thread Sławek Żak
On 4/18/05, c0ldbyte <[EMAIL PROTECTED]> wrote:
> On Mon, 18 Apr 2005, [ISO-8859-2] SÂawek Âak wrote:
> 
> > Hi,
> >
> > After install from CD the keyboard doesn't work on this machine. Has
> > anyone else seen it?
> >
> > /S
> 
> Select the correct key map screen map etc... ?

Erm. When I say keyboard doesn't work I *mean* it doesn't work at all.
The only key which works on the box is BRS, which doesn't give me
sufficient interaction with the system. I've skipped morse code
lessons and boy scouting in my life altogether.

/S
-- 
SÅawek Åak / UNIX Systems Administrator
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: 5.4-RC2 keyboard problem on Dell PowerEdge 2850

2005-04-18 Thread c0ldbyte
On Mon, 18 Apr 2005, [ISO-8859-2] S³awek ¯ak wrote:
On 4/18/05, c0ldbyte <[EMAIL PROTECTED]> wrote:
On Mon, 18 Apr 2005, [ISO-8859-2] SÂawek Âak wrote:
Hi,
After install from CD the keyboard doesn't work on this machine. Has
anyone else seen it?
/S
Select the correct key map screen map etc... ?
Erm. When I say keyboard doesn't work I *mean* it doesn't work at all.
The only key which works on the box is BRS, which doesn't give me
sufficient interaction with the system. I've skipped morse code
lessons and boy scouting in my life altogether.
/S
LOL allright just figured I would ask. It sounded like to me that you
allready got the system installed and you couldnt use the keyboard from
that point on. Hmm interesting my Dear Watson.
Anyway, Best of luck.
--c0ldbyte
--
( When in doubt, use brute force. -- Ken Thompson 1998 )___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: ASUS DRW-1608P, doesn't write anything

2005-04-18 Thread David Cross
On Sat, 2005-04-16 at 02:16 -0400, David E. Cross wrote:
> I have problem with an ASUS DRW-1609P with both 5.3 and 5.4.  It won't
> write any media.  Even "burncd" fails with the following error:
> 
> (Yes, I know I have "test" mode on, I got tired of making coasters)
> > burncd -f /dev/acd0 -s max -v -t data file.iso  fixate
> > adding type 0x08 file mp3.iso.aa size 72 KB 36 blocks
> > next writeable LBA 2136
> > addr = 2136 size = 73728 blocks = 36
> > writing from file mp3.iso.aa size 72 KB
> > written this track 1120 KB (0%) total 1120 KB
> > only wrote -1 of 32768 bytes: Device busy
> 
> Relevent line from dmesg:
> 
> acd0: DVDR  at ata1-master PIO4
> 
> atapicam doesn't fix it.  UDMA doesn't fix it.  GENERIC kernel.
> 
> Reading works fine.
> 
> Suggestions?
> 

Ok, let me ammend this a bit... cdrecord _does_ work.  I had tried
burncd and growisofs (using CAM) for the ATAPI and ATAPICAM methods.  So
apparently I can burn cds using atapicam and dvds using dvdrecord (from
savanah, this should really be brought into ports).  I would like burncd
to work, as I don't like opening my entire bus to just write optical
media.  Any clues on where I should look for this?

-- 
David E. Cross

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: ASUS DRW-1608P, doesn't write anything

2005-04-18 Thread Scott Long
David Cross wrote:
On Sat, 2005-04-16 at 02:16 -0400, David E. Cross wrote:
I have problem with an ASUS DRW-1609P with both 5.3 and 5.4.  It won't
write any media.  Even "burncd" fails with the following error:
(Yes, I know I have "test" mode on, I got tired of making coasters)
burncd -f /dev/acd0 -s max -v -t data file.iso  fixate
adding type 0x08 file mp3.iso.aa size 72 KB 36 blocks
next writeable LBA 2136
addr = 2136 size = 73728 blocks = 36
writing from file mp3.iso.aa size 72 KB
written this track 1120 KB (0%) total 1120 KB
only wrote -1 of 32768 bytes: Device busy
Relevent line from dmesg:
acd0: DVDR  at ata1-master PIO4
atapicam doesn't fix it.  UDMA doesn't fix it.  GENERIC kernel.
Reading works fine.
Suggestions?

Ok, let me ammend this a bit... cdrecord _does_ work.  I had tried
burncd and growisofs (using CAM) for the ATAPI and ATAPICAM methods.  So
apparently I can burn cds using atapicam and dvds using dvdrecord (from
savanah, this should really be brought into ports).  I would like burncd
to work, as I don't like opening my entire bus to just write optical
media.  Any clues on where I should look for this?
Whether you are using cdrecord or burncd or whatnot, you're sending
MMC-class SCSI commands to the burner to do the work.  cdrecord is much 
more sophisticated in how it does this than burncd (hence why ATAPICAM
is needed and not the canned ioctls that stock ATA provides to burncd),
so it's likely that your drive has some sort of quirk that burncd can't
cope with.  Probably the best way to get this fixed is provide access to
the hardware to Soeren.  Barring that, atapicam + burncd is a fine
replacement.  I'm not sure what you mean by 'opening the entire bus',
though.

Scott
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"