Jails: An rc.d script

2004-05-22 Thread William M. Grim
Hi!
I've written an rc.d script that can start/stop/restart jails, if they 
follow a certain pattern of setup.  I'm strongly considering the 
placement of this in ports or base (ports seems most appropriate).

Basically, if you have jails in /usr/local/var/jail/IP, my script can 
start it up automatically, as long as the IP is reachable by `host` (I 
know, it requires a little more work to remove this dependency for 
192.168. addresses, etc).

However, I was wondering if anyone would want to test it?  All you have 
to do is take my attached script and place it in /usr/local/etc/rc.d/.  
If you have your jails located somewhere else, then edit the JAILBASE= 
line in the script.

I would appreciate any constructive criticism about this script so that 
I can make it better.  If you have any improvements you make, feel free 
to send them to me as well.  I'll attempt to make it better over time 
and to write a man page for it.

Many thanks.
--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Jails: An rc.d script

2004-05-22 Thread William M. Grim
Very odd, my jails.sh script was not allowed to pass or something.  So, 
I'm pasting it into this email.

#!/bin/sh
#
# Start the jails at boot-up.
# The only jails it can start properly are the ones in directories labelled
# with an IP address.
JAILBASE=/usr/local/var/jail
LS=/bin/ls
JLS=/usr/sbin/jls
AWK=/usr/bin/awk
GREP=/usr/bin/grep
HOST=/usr/bin/host
MOUNT=/sbin/mount
UMOUNT=/sbin/umount
SH=/bin/sh
JAIL=/usr/sbin/jail
KILLALL=/usr/bin/killall
start_jails()
{
   for JAILIP in `${LS} -1 ${JAILBASE}`; do
   ${MOUNT} -t devfs devfs ${JAILBASE}/${JAILIP}/dev
   ${MOUNT} -t procfs proc ${JAILBASE}/${JAILIP}/proc
   JAILHOST=`${HOST} ${JAILIP} | ${AWK} '{ print $5; }'`
   ${JAIL} ${JAILBASE}/${JAILIP} ${JAILHOST} ${JAILIP} 
${SH} /etc/rc
   done
}
   

stop_jails()
{
   echo Even though you are stopping the jails, the JID may show up
   echo when doing \`jls\`.  This is most likely because some 
connectionsecho are waiting to timeout.
   

   for JID in `${JLS} | ${GREP} -v JID | ${AWK} '{ print $1; }'`; do
   ${KILLALL} -j ${JID}
   echo Killing JID: ${JID}
   done
   

   for JAILIP in `\ls -1 ${JAILBASE}`; do
   ${UMOUNT} -f ${JAILBASE}/${JAILIP}/proc
   ${UMOUNT} -f ${JAILBASE}/${JAILIP}/dev
   done
}
case $1 in
   start)
   start_jails
   ;;
   restart)
   stop_jails
   sleep 1
   start_jails
   ;;
   stop)
   stop_jails
   ;;
esac
Thanks again, and sorry for the confusion.
William M. Grim wrote:
Hi!
I've written an rc.d script that can start/stop/restart jails, if they 
follow a certain pattern of setup.  I'm strongly considering the 
placement of this in ports or base (ports seems most appropriate).

Basically, if you have jails in /usr/local/var/jail/IP, my script 
can start it up automatically, as long as the IP is reachable by 
`host` (I know, it requires a little more work to remove this 
dependency for 192.168. addresses, etc).

However, I was wondering if anyone would want to test it?  All you 
have to do is take my attached script and place it in 
/usr/local/etc/rc.d/.  If you have your jails located somewhere else, 
then edit the JAILBASE= line in the script.

I would appreciate any constructive criticism about this script so 
that I can make it better.  If you have any improvements you make, 
feel free to send them to me as well.  I'll attempt to make it better 
over time and to write a man page for it.

Many thanks.

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


--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: IP frag need

2004-05-19 Thread William M. Grim
Dmitry A. Bondareff wrote:
Hello hackers!
I have two office in the Internet.
And now I trying to make VPN between it.
I using mpd for it.
Client --- (mtu=1500) FreeBSD (mtu=1024) == VPN over Internet
== (mtu=1024)FreeBSD (mtu=1500)--- WindowsNT
Client trying to use mounted disk from WindowsNT
11.8.24.25 - WindowsNT
11.8.11.1 - FreeBSD
tcpdump info:
17:26:55.100097 11.8.24.25.139  11.8.11.1.1049: tcp 1460 (DF)
17:26:55.100175 11.8.11.1  11.8.24.25: icmp: 11.8.11.1 unreachable - need
to frag (mtu 1024) (DF)
17:26:57.287737 11.8.24.25.139  11.8.11.1.1049: tcp 1460 (DF)
17:26:57.287813 11.8.11.1  11.8.24.25: icmp: 11.8.11.1 unreachable - need
to frag (mtu 1024) (DF)
As you can see IP frag needed, but WindowsNT don't want to do it.
What I cat do on FreeBSD box to solve the problem ??
Dmitry.
(Sorry for my English)
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]
 

Please send these types of questions to [EMAIL PROTECTED]  
I'm not an admin here, but I think that place would be more appropriate.

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Remote Debugging using GDB on Linux

2004-04-20 Thread William M. Grim
Hi!

Is it possible to do remote debugging of the FreeBSD kernel over a 
serial connection using Linux?  FreeBSD has a special -k switch that 
Linux does not for GDB; so, I'm not even sure it's possible without a 
lot of work.

Thanks in advance for your replies.

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Remote Debugging using GDB on Linux

2004-04-20 Thread William M. Grim
Marcel Moolenaar wrote:

On Tue, Apr 20, 2004 at 03:17:56AM -0500, William M. Grim wrote:
 

Hi!

Is it possible to do remote debugging of the FreeBSD kernel over a 
serial connection using Linux?  FreeBSD has a special -k switch that 
Linux does not for GDB; so, I'm not even sure it's possible without a 
lot of work.
   

Most of the logic is in the gdb stub, which lives in the kernel. You
don't have to use -k to be able to remote debug the kernel. It may
have to be a cross-debugger (host=*-*-linux*, target=*-*-freebsd*).
In principle it should not be necessary, provided the host and target
architectures are the same.
In short: try it. chances are it works. If not, try with a cross-gdb.

HTH,

 

No problem.  Once my serial cable gets here I will try it.

Thanks.

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: machine/atmoic.h

2004-02-14 Thread William M. Grim
Atomic functions often serve purposes in mutexes and SMP.  You want to 
be able to lock a mutex in one cycle (at least few enough cycles 
guaranteed to be executed before another process is scheduled).  If you 
try to lock a mutex without using atomic functions, then two processes 
might try to lock a mutex at the same time and both get stuck in a 
deadlock.  This would sorta suck.

Eirik Nygaard wrote:

Hi...

I am just wondering what the atomic_* functions in machine/atmoic.h does.
I have read the assembly code and more or less understood it, but I still
don't see the need for it. So if anyone would enlighten me that would be 
great.

 

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: cons25 and xterm

2004-01-29 Thread William M. Grim
Erik Trulsson wrote:

On Thu, Jan 29, 2004 at 03:16:37PM -0800, zera holladay wrote:
 

Hello, when I ssh to my school Unix account
(unfortunately solaris) from my local host's command
line and when I attempt to clear the screen, I get an
error message from the remote host: `cons25`: unknown
terminal type.  The remote host is $TERM=xterm.  My
local machine is FreeBSD's default $TERM=cons25.  

My question is: how can I switch my local terminal
type so that it works correctly with the remote
machine?  I don't want to install X, but if that is
the only option then I'll reconsider.
   

The way I handle that problem is to run screen(1) (from the
sysutils/screen port) locally, and set TERM=vt102 on the remote
machine.  Works perfectly.
The correct solution is of course to upgrade the terminal
descriptions on the remote machine to include 'cons25', but that might
not be practical in this case.
 

In your .profile (or equivalent file) on the remote system, set 
TERM=ansi.  ansi terminals on Sun have full colors support, etc.

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: symlink: /home - /usr/home vs. /home - usr/home in default installation

2004-01-24 Thread William M. Grim
Dmitry Morozovsky wrote:

On Fri, 23 Jan 2004, Andriy Tkachuk wrote:

AT The idea is this: if you mount your / to another
AT place (for example /mnt on another computer), your
AT /mnt/home will point to correct place (/mnt/usr/home)
AT instead of /usr/home.
AT
AT What do you, falks, think about this?
FWIW, I'm making virtually every symlink relative instead of absolute for just
this reason. (To be exact, more similar to Solaris' approach, so
/sys - ./usr/src/sys and /home - ./usr/home)
 

This is the second time I've posted about this, but I'm beginning to 
think this is a very good idea.  I really don't foresee any problems 
with it.  Since you guys already have some of this work complete, 
perhaps you could submit a PR for it?

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: symlink: /home - /usr/home vs. /home - usr/home in default installation

2004-01-23 Thread William M. Grim
Andriy Tkachuk wrote:



The idea is this: if you mount your / to another
place (for example /mnt on another computer), your
/mnt/home will point to correct place (/mnt/usr/home)
instead of /usr/home.
What do you, falks, think about this?

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


That idea seems good to me.  I don't forsee any issues with it.

--
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


FreeBSD 5.1 Automount - amd.map help?

2003-12-10 Thread William M. Grim
Hey again!  Thanks for the previous help trying to update from 5.1 to 5.2.

Now, I'm trying to setup amd and have setup and amd.conf to go along with
it (I have attached amd.conf).  In rc.conf, I have also cleared the
amd_flags so that it loads amd.conf.

However, I was curious how the /etc/amd.map (also attached) that comes with the
default install works?  The man pages are rather skimpy on information.  I
only got the amd.conf file working by following the example,
/usr/src/contrib/amd/scripts/amd.conf-sample.

Thanks again for any help.  Also, does anyone know any good site that
describes how the amd.map works so that I can create my own?  I'd like to
automount home directories and other exports off of remote servers (not using
fstab).
-- 
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]


[ global ]
normalize_hostnames =   yes
restart_mounts =yes
unmount_on_exit =   yes
auto_dir =  /a
cache_duration =300
#local_domain = dnsalias.net
print_version = no
log_file =  /var/log/amd
dismount_interval = 120
#nis_domain =   grimnet.dnsalias.net
log_options =   fatal,error,user,warn,info,map,stats,all
#debug_options =all
plock = no
selectors_in_defaults = yes
show_statfs_entries =   yes

# LDAP (Lightweight Directory Access Protocol) options
#ldap_base =ou=Marketing, o=AMD Ltd, c=US
#ldap_hostports =   ldap.your.domain:389
#ldap_cache_seconds =   0
#ldap_cache_maxmem =131072

hesiod_base =   automount

# these 5 options can be overridden by each map individually
browsable_dirs =yes
map_options =   cache:=all
map_type =  file
mount_type =nfs
search_path =   /etc/amdmaps

# alternate RPC program number to register with the port mapper
portmap_program =   300019-300029
fully_qualified_hosts = yes
nfs_vers =  3
nfs_proto = tcp

##
# DEFINE AN AMD MOUNT POINT
[ /home ]
# map name must be defined, all else are optional
map_name =  /etc/amd.home
map_options =   cache:=all
# if map type is not defined, will search all map types (default)
#map_type = file|hesiod|ndbm|nis|nisplus|passwd|union|ldap
#search_path =  /etc/local:/etc/amdmaps:/misc/yp
# an amd or autofs mount point
mount_type =nfs
browsable_dirs =yes
# an optional tag to be used with amd -T tag. untagged entries are always
# used.  Tagged ones get used only if specified with amd -T
#tag =  test

##
# DEFINE ANOTHER AMD MOUNT POINT
[ /src ]
#map_name = /usr/local/lib/amdmaps/amu.src
# regular amd (nfs) mount point (default)
# don't try the autofs type.  It is not implemented yet.
#mount_type = nfs

##
# $FreeBSD: src/etc/amd.map,v 1.9 2002/05/15 22:24:29 obrien Exp $
#
/defaults   type:=host;fs:=${autodir}/${rhost}/host;rhost:=${key}
*   opts:=rw,grpid,resvport,vers=3,proto=udp,nosuid,nodev
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


FBSD 5-CURRENT: Kernel Makefile.inc1 Error

2003-12-06 Thread William M. Grim
Hey there!  I'm having a slight problem performing a build on my FreeBSD 5.1
machine.  I downloaded the 5-CURRENT source code and only added the line,
device pcm to the GENERIC kernel, renaming it to ZEUS.

Then, I went into /usr/src and typed make buildkernel KERNCONF=ZEUS, and it
immediately came up with the errors:
--
-su-2.05b# make buildkernel
/usr/src/Makefile.inc1, line 745: warning: String comparison operator should be 
either == or !=
/usr/src/Makefile.inc1, line 745: Malformed conditional ((!defined(NO_RESCUE) ||  
defined(RELEASEDIR))   (${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING}  
501101))
/usr/src/Makefile.inc1, line 745: Need an operator
/usr/src/Makefile.inc1, line 747: if-less endif
/usr/src/Makefile.inc1, line 747: Need an operator
make: fatal errors encountered -- cannot continue
*** Error code 1

Stop in /usr/src.
--

The problem is with ${BOOTSTRAPING}  501101).  For some reason, it is
suddenly expecting BOOSTRAPPING to be a string, when it is apparent earlier in
the Makefile.inc1 that it is not.

I tried patching this on my own but failed; would someone more experienced
be able to patch this for me?

I have attached my dmesg and Makefile.inc1 to this as well just in case
someone wishes to view them.
-- 
William Michael Grim
Student, Southern Illinois University at Edwardsville
Unix Network Administrator, SIUE, Computer Science dept.
Phone: (217) 341-6552
Email: [EMAIL PROTECTED]


#
# $FreeBSD: src/Makefile.inc1,v 1.397 2003/11/16 21:17:43 gordon Exp $
#
# Make command line options:
#   -DNO_DYNAMICROOT do not link /bin and /sbin dynamically
#   -DNO_KERBEROS Do not build Heimdal (Kerberos 5)
#   -DNO_RESCUE do not build rescue binaries
#   -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
#   -DNOCLEAN do not clean at all
#   -DNOCRYPT will prevent building of crypt versions
#   -DNOMAN do not build the manual pages
#   -DNOPROFILE do not build profiled libraries
#   -DNOGAMES do not go into games subdir
#   -DNOSHARE do not go into share subdir
#   -DNOINFO do not make or install info files
#   -DNOLIBC_R do not build libc_r.
#   -DNO_FORTRAN do not build g77 and related libraries.
#   -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
#   -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
#   -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
#   -DNO_PORTSUPDATE do not update ports in ${MAKE} update
#   -DNO_DOCUPDATE do not update doc in ${MAKE} update
#   LOCAL_DIRS=list of dirs to add additional dirs to the SUBDIR list
#   TARGET_ARCH=arch to crossbuild world to a different arch

#
# The intended user-driven targets are:
# buildworld  - rebuild *everything*, including glue to help do upgrades
# installworld- install everything built by buildworld
# update  - convenient way to update your source tree (eg: sup/cvs)
#
# Standard targets (not defined here) are documented in the makefiles in
# /usr/share/mk.  These include:
#   obj depend all install clean cleandepend cleanobj

# Put initial settings here.
SUBDIR=

# We must do share/info early so that installation of info `dir'
# entries works correctly.  Do it first since it is less likely to
# grow dependencies on include and lib than vice versa.
.if exists(${.CURDIR}/share/info)
SUBDIR+= share/info
.endif

.if exists(${.CURDIR}/include)
SUBDIR+= include
.endif
.if exists(${.CURDIR}/lib)
SUBDIR+= lib
.endif

# When upgrading to a dynamically linked root, install the runtime
# linker early into its new location before make(1) has a chance
# to run the dynamically linked /bin/sh.
.if !defined(NO_DYNAMICROOT)  !defined(NOPIC)  \
(!defined(TARGET_ARCH) || ${TARGET_ARCH} == ${MACHINE_ARCH})  \
!defined(DISTDIR)  \
(!defined(DESTDIR) || empty(DESTDIR) || ${DESTDIR} == /)  \
!exists(/libexec/ld-elf.so.1)
SUBDIR+= libexec/rtld-elf
.endif

.if exists(${.CURDIR}/bin)
SUBDIR+= bin
.endif
.if exists(${.CURDIR}/games)  !defined(NOGAMES)
SUBDIR+= games
.endif
.if exists(${.CURDIR}/gnu)
SUBDIR+= gnu
.endif
.if exists(${.CURDIR}/kerberos5)  exists(${.CURDIR}/crypto)  \
!defined(NOCRYPT)  !defined(NO_OPENSSL)  !defined(NO_KERBEROS)
SUBDIR+= kerberos5
.endif
.if exists(${.CURDIR}/libexec)
SUBDIR+= libexec
.endif
.if exists(${.CURDIR}/rescue)  !defined(NO_RESCUE)
SUBDIR+= rescue
.endif
.if exists(${.CURDIR}/sbin)
SUBDIR+= sbin
.endif
.if exists(${.CURDIR}/secure)  !defined(NOCRYPT)
SUBDIR+= secure
.endif
.if exists(${.CURDIR}/share)  !defined(NOSHARE)
SUBDIR+= share
.endif
.if exists(${.CURDIR}/sys)
SUBDIR+= sys
.endif
.if exists(${.CURDIR}/usr.bin)
SUBDIR+= usr.bin
.endif
.if exists(${.CURDIR}/usr.sbin)
SUBDIR+= usr.sbin
.endif

# etc must be last for distribute to work
.if exists(${.CURDIR}/etc)
SUBDIR+= etc
.endif

# These are last, since it is nice to at least get the base system
# rebuilt 

CMD Tech. PCI-0680 Driver

2002-10-05 Thread William M. Grim

Hey there!

I'm very new to this list and couldn't find a better one to post too
(please let me know if I should post elsewhere).

Anyway, I'm looking to update the ATA driver so that my new ATA/133 card
with a Silicon Images' PCI-0680 chipset works.  I bought the card from
CMD Technologies.  Apparently, ata/33 on up to ata/100 is supported for
their line of cards according to the 4.6.2 release notes.

Being new to driver development, the problem I'm having with this is
knowing exactly WHICH source files I'm probably going to have to change;
I was thinking either the ata-raid.h/.c or the ata-disk.h/.c.  I could
be way off here, and that's why I'm asking.  I also realize that I'll
probably need to get some sort of programming tech. documents from the
company of this card?  How would I go about doing this if I need to
perform this step?

Any help is appreciated, and as a side note, I've never done driver
development before.  I was thinking that since I have a keen interest in
making this card work, this would be a good place to begin.

I also have the pciconf -lv information to aid in your response to me:

none0@pci0:11:0:class=0x010400 card=0x36801095 chip=0x06801095
rev=0x01 hdr=0x00
vendor   = 'CMD Technology Inc.'
device   = 'PCI-0680 Ultra ATA133 EIDE Controller'
class= mass storage
subclass = RAID

Thanks so much again for any help that can be offered,
Mike

PS - Don’t forget to direct me to another mailing list if this one is
not quite appropriate for driver development talk.  Thanks!


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message