Monitoring CPU time

2010-04-04 Thread Francois Tigeot
Hi,

I'm currently playing with munin http://munin-monitoring.org/ and I would like
to monitor the CPU usage on DragonFly hosts.

The FreeBSD plugin uses the sysctl kern.cp_time, which is not present on
DragonFly. Is there any way to easily get the different percentages of nice,
idle, user, system, etc... time from a shell ?

FreeBSD cpu usage plugin sources:
http://munin-monitoring.org/browser/trunk/node/node.d.freebsd/cpu.in?rev=900

-- 
Francois Tigeot


how to switch the base compiler to gcc 4.4.2

2010-04-04 Thread Saifi Khan
Hi:

How does one switch the base compiler to gcc 4.4.2 ?

Here is some info for my setup:

 . running DragonFly 2.7-DEVELOPMENT v2.7.0.47.g3f16d 
   (HEAD as of April 4, 2010).

 . the HEAD was built with CCVER=gcc44 for
   - buildworld
   - buildkernel
   - installkernel
   - installworld
   - upgrade

 . /usr/libexec/gcc44 directory has
   CC
   c++
   c++filt
   cc
   cc1obj
   cc1plus
   cpp
   g++
   gcc
   gcov


 . have setup the following entries in /etc/make.conf
   CCVER=gcc44
   CC=gcc44
   CXX=g++44
   CPP=cpp44
   CFLAGS+=-mssse3

i donot see any /etc/libmap.conf (as seen in FreeBSD) which 
needs to be tweaked for rtld and ldd.

Any pointers as to how to make gcc 4.4.2 as the base compiler 
for my custom DragonFlyBSD system on AMD64 box ?


--
thanks
Saifi.


Laptop still doesn't boot with ACPI

2010-04-04 Thread Pierre Abbat
http://bugs.dragonflybsd.org/issue1559
I updated the kernel on March 28 (v2.5.1.1080.ga68e0-DEVELOPMENT) and tried 
booting with ACPI enabled. It still doesn't work.

Pierre
-- 
lo ponse be lo mruli po'o cu ga'ezga roda lo ka dinko


Re: Monitoring CPU time

2010-04-04 Thread Chris Turner

Francois Tigeot wrote:


The FreeBSD plugin uses the sysctl kern.cp_time, which is not present on
DragonFly. Is there any way to easily get the different percentages of nice,
idle, user, system, etc... time from a shell ?

there might be a better way to do this - but you can snag that 
particular set of data from vmstat -c 1 ..




2.6 release status update

2010-04-04 Thread Matthew Dillon
The ISOs and IMGs for 2.6 will be built and uploaded this afternoon,
and made available to release users.

The official announcement is being held pending the i386 bulk package
build finishing.  It should finish today but we still need to give
the mirrors a day or two to get the packages before we announce.
The x86_64 bulk build finished and is on avalon already.

It has been quite a slog but we're on the final lap!

-Matt
Matthew Dillon 
dil...@backplane.com


[PATCH] mount_tmpfs command

2010-04-04 Thread Naoya Sugioka
Hello,

Here attached is the patch for latest tmpfs related command updates:

 1. -f options for max filesize
 2. -o options now supports uid/gid/mode/inodes/size/maxfilesize
descriptive options
 3. corresponding tmpfs(5) mount_tmpfs(8) change.

Please accept this patch for latest head.

thank you,
-Naoya
diff --git a/sbin/mount_tmpfs/mount_tmpfs.8 b/sbin/mount_tmpfs/mount_tmpfs.8
index c3a9afc..d9fcfab 100644
--- a/sbin/mount_tmpfs/mount_tmpfs.8
+++ b/sbin/mount_tmpfs/mount_tmpfs.8
@@ -36,6 +36,7 @@
 .Nd mount an efficient memory file system
 .Sh SYNOPSIS
 .Nm
+.Op Fl f Ar maxfilesize
 .Op Fl g Ar group
 .Op Fl m Ar mode
 .Op Fl n Ar nodes
@@ -61,6 +62,8 @@ described below.
 .Pp
 The following options are supported:
 .Bl -tag -width XoXoptions
+.It Fl f Ar maxfilesize
+Specifies the maximum file size of the file system.
 .It Fl g Ar group
 Specifies the group name or GID of the root inode of the file system.
 Defaults to the mount point's GID.
@@ -78,9 +81,11 @@ Options are specified with a
 flag followed by a comma-separated string of options.
 See the
 .Xr mount 8
+and
+.Xr tmpfs 5
 man page for possible options and their meanings.
 .It Fl s Ar size
-Specifies the total file system size in bytes.
+Specifies the total file system size.
 If zero is given (the default), the available amount of memory (including
 main memory and swap space) will be used.
 Note that four megabytes are always reserved for the system and cannot
@@ -118,13 +123,14 @@ group, with a restricted 0700 mode:
 .Pp
 .Ic mount -t tmpfs -o -s20M -o -ujoe -o -gusers -o -m0700 tmpfs /mnt
 .Pp
-See
-.Pa /usr/share/examples/fstab/fstab.ramdisk
-for some examples on how to add tmpfs entries to
-.Pa /etc/fstab .
+or
+.Pp
+.Ic mount -t tmpfs -o size=20M,uid=joe,gid=users,mode=0700 tmpfs /mnt
+.Pp
 .Sh SEE ALSO
 .Xr fstab 5 ,
-.Xr mount 8
+.Xr mount 8 ,
+.Xr tmpfs 5
 .Sh HISTORY
 The
 .Nm
diff --git a/sbin/mount_tmpfs/mount_tmpfs.c b/sbin/mount_tmpfs/mount_tmpfs.c
index 98d221d..f36787d 100644
--- a/sbin/mount_tmpfs/mount_tmpfs.c
+++ b/sbin/mount_tmpfs/mount_tmpfs.c
@@ -58,8 +58,18 @@
 
 /* - */
 
+#define MOPT_TMPFSOPTS \
+   { gid=,   0,  MNT_GID, 1},\
+   { uid=,   0,  MNT_UID, 1},\
+   { mode=,  0,  MNT_MODE, 1},   \
+   { inodes=,0,  MNT_INODES, 1}, \
+   { size=,  0,  MNT_SIZE, 1},   \
+   { maxfilesize=,   0,  MNT_MAXFSIZE, 1}
+
+
 static const struct mntopt mopts[] = {
MOPT_STDOPTS,
+   MOPT_TMPFSOPTS,
MOPT_NULL
 };
 
@@ -68,6 +78,7 @@ static const struct mntopt mopts[] = {
 static gid_t   a_gid(char *);
 static uid_t   a_uid(char *);
 static mode_t  a_mask(char *);
+static int64_t a_number(char *s);
 static voidusage(void) __dead2;
 
 /* - */
@@ -82,14 +93,16 @@ mount_tmpfs_parseargs(int argc, char *argv[],
gid_t gid;
uid_t uid;
mode_t mode;
-   int64_t tmpnumber;
struct stat sb;
+   int extend_flags = 0;
+   char *ptr, *delim;
 
/* Set default values for mount point arguments. */
memset(args, 0, sizeof(*args));
args-ta_version = TMPFS_ARGS_VERSION;
args-ta_size_max = 0;
args-ta_nodes_max = 0;
+   args-ta_maxfsize_max = 0;
*mntflags = 0;
 
gidset = 0; gid = 0;
@@ -97,8 +110,12 @@ mount_tmpfs_parseargs(int argc, char *argv[],
modeset = 0; mode = 0;
 
optind = optreset = 1;
-   while ((ch = getopt(argc, argv, g:m:n:o:s:u:)) != -1 ) {
+   while ((ch = getopt(argc, argv, f:g:m:n:o:s:u:)) != -1 ) {
switch (ch) {
+   case 'f':
+   args-ta_maxfsize_max = a_number(optarg);
+   break;
+
case 'g':
gid = a_gid(optarg);
gidset = 1;
@@ -110,23 +127,97 @@ mount_tmpfs_parseargs(int argc, char *argv[],
break;
 
case 'n':
-   if (dehumanize_number(optarg, tmpnumber)  0) {
-   fprintf(stderr, bad number for -n\n);
-   usage();
-   }
-   args-ta_nodes_max = tmpnumber;
+   args-ta_nodes_max = a_number(optarg);
break;
 
case 'o':
-   getmntopts(optarg, mopts, mntflags, 0);
+   getmntopts(optarg, mopts, mntflags, extend_flags);
+   if (extend_flags  MNT_GID) {
+   ptr = strstr(optarg, gid=);
+   if(ptr) {
+   delim = strstr(ptr, ,);
+   if (delim) {
+   *delim = '\0';
+   gid = 

Re: Monitoring CPU time

2010-04-04 Thread Francois Tigeot
On Sun, Apr 04, 2010 at 03:01:47PM +, Chris Turner wrote:
 Francois Tigeot wrote:
 
 The FreeBSD plugin uses the sysctl kern.cp_time, which is not present on
 DragonFly. Is there any way to easily get the different percentages of 
 nice,
 idle, user, system, etc... time from a shell ?
 
 there might be a better way to do this - but you can snag that 
 particular set of data from vmstat -c 1 ..

Thanks for the tip, it's almost what I want.

FreeBSD:
$ sysctl kern.cp_time
kern.cp_time: 1797279 579339 1349174 128959 811149589

DragonFly:
$ vmstat -c 1 | tail -n 1 | awk '{ print $14,$15,$16 }'
675875492 705365686 1527141678

Unfortunately, there's no data for nice or interrupt. Time to dig into top
sources...

-- 
Francois Tigeot


Re: 2.6 release status update

2010-04-04 Thread Justin C. Sherrill
On Sun, April 4, 2010 12:08 pm, Matthew Dillon wrote:
 The ISOs and IMGs for 2.6 will be built and uploaded this afternoon,
 and made available to release users.

 The official announcement is being held pending the i386 bulk package
 build finishing.  It should finish today but we still need to give
 the mirrors a day or two to get the packages before we announce.
 The x86_64 bulk build finished and is on avalon already.

 It has been quite a slog but we're on the final lap!

Technically, we're OK now - the 2.6 build of pkgsrc-2009Q4 packages is
already done, from df.v12.su:

http://avalon.dragonflybsd.org/packages/i386/DragonFly-2.6/pkgsrc-2009Q4/All/

Since pkgsrc-2009Q4 for 2.4.1 was already built on that machine before the
2.6 update, any of the packages that were unchanged were fine, so it was
able to go with those.  They'll cause the annoying warning: built on
DragonFly version X even though you are on DragonFly version Y warning,
but they should be just fine; we didn't do anything to break binary
compatibility between 2.4 and 2.6 as I recall.




Source IP

2010-04-04 Thread Walter

Hi,

I'm getting log messages which say that login failures are
from a specific URL rather than an IP,  I tried running
ftpd with the -h option but it didn't fix this...

So, can anyone tell me how I can make ftpd always give me
the IP rather than, sometimes, the URL?  Alternatively, can
someone point me to C code which will allow me to convert
a URL to an IP?

Thanks,

Walter