Re: How to forward old root mails to an external email address?

2011-02-22 Thread Paul Chvostek
On Sat, Feb 19, 2011 at 11:39:38PM +0100, Andy Wodfer wrote:
> On Sat, Feb 19, 2011 at 11:14 PM, RW  wrote:
> > On Sat, 19 Feb 2011 22:39:59 +0100
> > Andy Wodfer  wrote:
> >
> > > I already tried something similare, but I keep getting command not
> > > found for formail. I was hoping there was a way of doing this without
> > > installing additional software - just use what comes with a default
> > > FreeBSD installation.
> >
> > formail is installed as part of the procmail package. Check for typos
> > and that PATH is set correctly.
> >
> 
> Cool. Procmail is now installed, but the procmail.rc file, should that be
> placed under root's home folder ie /root/procmail.rc or another user? I
> assume root since Daniel's command doesn't specify any users?

If you're not planning to use procmail to deliver your mail, you don't
need to worry about a procmailrc file.  The reason to install procmail
was to get "formail", which does not use the procmailrc file.

> That would mean I'm logged in as root, run the command, formail sends all
> mails to procmail which sees the alias in procmail rc and sends the mails
> out? Correct?

You could do it that way, but it requires more setup.  This is easier:

 # formail -s sendmail y...@example.com < /var/mail/root

p

-- 
  Paul Chvostek 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Cronjob

2009-06-08 Thread Paul Chvostek
Hi Jos,

On Mon, Jun 08, 2009 at 02:55:56PM +0200, Jos Chrispijn wrote:
> 
> I would like to execute a script on every last day of the month in my 
> crontab.
> Can someone tell me how I should solve that as it doesn't know which 
> month day is the last day of the month?
> Solving this in the script to be executed is no option.

The only solutions I see are the three-cronjob approach:

  0 1 31 1,3,5,7,8,10,12 * /path/to/script
  0 1 28 2   * /path/to/script
  0 1 30 4,6,9,11* /path/to/script

Alternately, you could do this with a single cronjob by putting a little
scripting intelligence into the crontab itself:

  0 1 28-31 * * test `date -v+1d '+%d'` -eq 1 && /path/to/script

That may be your easiest option.  The script only gets run on the
correct dates, but the cron job still gets run more frequently.

p

-- 
  Paul Chvostek 
  it.canadahttp://www.it.ca/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: What's wrong with this picture?

2009-06-05 Thread Paul Chvostek
Ian,

On Sun, May 31, 2009 at 04:00:40PM +1000, Ian Smith wrote:
> 
> Woj, 20 out of 36 messages, over 55% of all these messages, are by you.
...
> You are equally as capable in this role as wannabe list wrecker, opining 
> on every second message including all the silly wildly off-topic ones.

If you elect to filter this person's traffic, and are concerned that
you'll continue to be inundated with replies, I'd like to suggest a
small procmail script I wrote years ago.

http://www.it.ca/~paul/s/procmail-filter-msgid

It caches the message-id of the troll's posts and filters the message
(redirect or bitbucket).  It then caches the message-id of any message
that includes a cached message-id in its headers (i.e. In-Reply-To,
Refererences) and filters that too.  The effect is to hide not just the
troll's mail, but all the conversations he starts.

I haven't actively used this thing since 2003, but procmail hasn't
changed much in that time either.  Hope it helps.

Sometimes killing the trolls is just too much effort.

-- 
  Paul Chvostek 
  it.canadahttp://www.it.ca/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Why the extra shells?

2008-09-10 Thread Paul Chvostek
Hi John,

On Mon, Sep 01, 2008 at 08:43:49AM -0400, John Almberg wrote:
> 
> This is my main concern at the moment... I am wondering if I killed  
> off an essential process when I killed off those shells...

Probably not.  Your `ps` output was:

  [on:~]> ps
PID  TT  STAT  TIME COMMAND
  30350  p0  Ss 0:00.03 -bash (bash)
  30761  p0  R+ 0:00.00 ps
  99069  p1  Is+0:00.01 /usr/local/bin/bash
  79966  p3  Is 0:00.01 /usr/local/bin/bash
  27050  p4  Is+0:00.01 /usr/local/bin/bash
  45342  p5  Is+0:00.01 /usr/local/bin/bash

The fact that your shells all have a small TIME column indicates that
they're not very active.  This is a good thing.

The "I" under STAT means it's an idle process, and the fact that it's
attached to a tty means it was started on a terminal.  The ones with a
"+" are foreground processes on their ttys.  I'd guess that these could
be shells processes that were never killed off when their terminals were
closed, but you can find out a little more about them, once you get some
more of them showing up.

`ps Olstart` will show you the date/time that a process was started.
You can compare this to the output of `last` to see if the dates and
ttys match up with your logins.

If they don't match up, they're probably not login shells, and more
investigation is required, possibly by using things like `ps uwwtp1` for
the shell on p1.  This will give you ALL the processes on that TTY,
including anything that might have been launched by bash (and therefore
possibly subject to a HUP sent by the shell as you kill it).

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: Regular Expression Trouble

2008-08-27 Thread Paul Chvostek
Hi Martin.

On Wed, Aug 27, 2008 at 08:25:02AM -0500, Martin McCormick wrote:
> 
> Aug 26 20:45:36 dh1 dhcpd: DHCPACK on 10.198.67.116 to 00:12:f0:88:97:d6
> (peaster-laptop) via 10.198.71.246 
> 
> That was one line broken to aid in emailing, but that's what
> types of lines are involved. The MAC appears at different field
> locations depending on the type of event being logged so awk is
> perfect for certain types of lines, but it misses others and no
> one awk expression gets them all.

While I agree with others that awk should be used with explicit
recognition of the particular lines, you can still snatch everything
with sed if you want to.  In FreeBSD, sed supported extended regex, so:

sed -nE 's/.*([0-9a-f]{2}(:[0-9a-f]{2}){5}).*/\1/p'

The "-n" option tells sed not to print the line unless instructed to
explicitely, and the "p" modifier at the end is that instruction.  As
for the regex ... well, that's straightforward enough.

>   This is an attempt to isolate every MAC address that
> appears and then sort and count them to see who is having
> trouble or, in some cases, is causing trouble.

Then you still may want to use awk for some of that...

cat /var/log/dhcpd.log | \
sed -nE 's/.*([0-9a-f]{2}(:[0-9a-f]{2}){5}).*/\1/p' | \
awk '
 { a[$1]++; }
 END {
  for(i in a){
   printf("%7.0f\t%s\n", a[i], i);
  }
 }
' | sort -nr

You can join the lines into a single command line if you like, or toss
it as-is into a tiny shell script.  Awk is forgiving about whitespace.

You should theoretically be able to feed the same regex to awk, but I've
found that awk's eregex support sometimes doesn't work as I'd expect.

Hope this helps.

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: Tailing logs

2008-08-26 Thread Paul Chvostek

On Fri, Aug 22, 2008 at 10:28:33AM -0400, DAve wrote:
>
> I would love to have a way to tail a log, like piping to grep, except I
> see every line and the lines I would normally grep for are highlighted.
> That would be cool. Anyone know of a bash command or tool that will do this?

I use tcsh as my shell.  The following alias works nicely for me in
xterm, but would have to be adjusted for anything else:

  alias highlight 'sed -E '\''s/\!:*/^[[1m&^[[0m/g'\'''

Replace "^[" with an escape character, twice.  Put it in your .tcshrc if
you like.  YMMV.

> Side note, I am tailing sendmail after changes to my outbound queue
> runners. I want to highlight my sm-mta-out lines but still see all lines.

Right, I do very similar stuff.  You'd use this like:

  tail -F /var/log/maillog | highlight .*sm-mta-out.*

Quotes seem to confound this alias.  I haven't bothered to fix that; as
long as what you're searching for doesn't glob a file, you should be
fine without quotes.

You can also do more complex things in either sed or awk, colour-coding
individual pattern matches.  Here's one in awk that I use to highlight
the activity of milter-greylist:

  #!/usr/bin/awk -f
  BEGIN {
red="^[[31m"; green="^[[32m";
yellow="^[[33m";  blue="^[[34m";
norm="^[[0m";
fmt="%s%s%s\n";
  }
  /autowhitelisted/ { printf(fmt, green, $0, norm); next; }
  /delayed for/ { printf(fmt, yellow, $0, norm); next; }
  # /skipping greylist/ { printf(fmt, blue, $0, norm); next; }
  { print; }

Same deal with the "^[".

Enjoy.

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: Best SMTP Gateway Program and Reporting Tools

2008-08-14 Thread Paul Chvostek
Hi Josh,

On Tue, Aug 12, 2008 at 03:22:55PM -0500, Josh Kidd wrote:
> 
> I just wanted to pose this question to the list on people's opinions as
> to what the best SMTP Gateway program (ie. Sendmail, Postfix, etc) is
> and what the best log analysis tool for that SMTP program is. 

All the advice from other messages stands.  Each package has its
benefits.  Everbody knows and supports sendmail, but it's annoying to
configure.  Postfix is great, easy to configure, and now with "milter"
support can do almost anything that Sendmail can.  Smail and Exim users
swear by their products, and I'm sure they're great (though I've never
used either).  Zmailer scales beautifully, though if you actually have
enough traffic to take advantage of its scaling, you should buy another
five mail servers.

As for the best log analysis tool ... it's not free, but I absolutely
adore Sawmill (http://www.sawmill.net/).  It will support any and all
log formats -- I currently use it with both Sendmail and Postfix logs.

Highly recommended.  And not very expensive.

> is our main requirement is to have a way to view the logs on a web based
> interface that will allow our system administrators when a customer
> complains they didn't receive an email to be able to go into the logs
> and search by date/time and view the activity for that period to
> determine if the mail went through our system or if it was blocked and
> if so why. 

Grep is your friend.  Innovative use of grep, even.  And if you use
sendmail, here's a tool I wrote many many years ago that's had regular
use over the years: http://www.it.ca/~paul/mailqgrep

I haven't yet adapted it to Postfix logs.  Trickier to parse.

> I've heard of and read about a few different programs like SMA and
> Anteater and pflogstats, but I don't know if these will have the
> functionality I need to allow admins to search logs for a specific
> date/time and/or specific phrase/address on a web based interface.

Yup.  The most detailed view of your log data is a direct one that you
can get using grep.  I don't know those other packages, but I do love
Sawmill's web UI.

(Hear that, Greg?  I'm marketing for ya! ;] )

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>

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


chio: /dev/ch0: CHIOMOVE: Device not configured

2008-04-11 Thread Paul Chvostek
Hiya.

I have a media changer:

  install# grep ch0 /var/run/dmesg.boot 
  ch0 at isp0 bus 0 target 0 lun 1
  ch0:  Removable Changer SCSI-5 device 
  ch0: 400.000MB/s transfers
  ch0: Command Queueing Enabled
  ch0: 48 slots, 2 drives, 1 picker, 0 portals

I can read status info from it:

  install# chio status | tail -8
  slot 42: 
  slot 43: 
  slot 44: 
  slot 45: 
  slot 46: 
  slot 47: 
  drive 0: 
  drive 1: 

But I can't send it commands:

  install# chio move drive 0 slot 45
  chio: /dev/ch0: CHIOMOVE: Device not configured
  install# tail -6 /var/log/messages
  Jan  2 22:05:19 install kernel: (ch0:isp0:0:0:1): MOVE MEDIUM. CDB: a5 0 0 0 
0 1 4 16 0 0 0 0 
  Jan  2 22:05:19 install kernel: (ch0:isp0:0:0:1): CAM Status: SCSI Status 
Error
  Jan  2 22:05:19 install kernel: (ch0:isp0:0:0:1): SCSI Status: Check Condition
  Jan  2 22:05:19 install kernel: (ch0:isp0:0:0:1): ILLEGAL REQUEST asc:25,0
  Jan  2 22:05:19 install kernel: (ch0:isp0:0:0:1): Logical unit not supported
  Jan  2 22:05:19 install kernel: (ch0:isp0:0:0:1): Unretryable error

What am I missing?

Thanks.  :)

p


-- 
  Paul Chvostek <[EMAIL PROTECTED]>

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


Re: OpenOffice.org 2.2.1 quits on launch

2007-07-03 Thread Paul Chvostek
On Wed, Jul 04, 2007 at 09:47:55AM +1000, Norberto Meijome wrote:
> Paul Chvostek <[EMAIL PROTECTED]> wrote:
> > 
> > Now, when I launch OO, it complains not at all, but opens no windows.
...
> > I'm in 6.1-RELEASE-p17.  Java (diablo-jdk1.5.0) works standalone, TTF
> > fonts work in other apps, and OO was built with these in /etc/make.conf:
> >   WITH_EVOLUTION2=yes
> >   WITH_TTF_BYTECODE_ENABLED=yes
> >   WITH_SYSTEM_FREETYPE=yes
> 
> What X toolkit? QT / KDE? GTK? 

GTK2, I'm running in Gnome.  For reference, this also happens when I try
to run OO from twm with no desktop manager.

I normally have $LANG set for other reasons, but I also noticed that
without it set, I see an error:

  I18N: Operating system doesn't support locale "en_US"

Presumably, OO was built with that as a default.  When I set
LANG="en_CA.UTF-8", the error doesn't show ... but it's notable that
this error is from /usr/local/openoffice.org-2.2.1/program/soffice.bin,
so I know the binary is running.

I still don't know why soffice.bin exits with a return value of 78.

> yes, see
> http://lists.freebsd.org/pipermail/freebsd-questions/2007-June/151700.html and
> the thread it belongs to.

An interesting thread, but my symptoms are different from yours.  I get
no crash.  I get no quick flahes of a window on the screen.  Setting the
OOO_FORCE_DESKTOP env var changes OO's behaviour not at all.

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>

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


Re: OpenOffice.org 2.2.1 quits on launch

2007-07-03 Thread Paul Chvostek
On Tue, Jul 03, 2007 at 03:29:46PM +0200, [LoN]Kamikaze wrote:
> 
> > Now, when I launch OO, it complains not at all, but opens no windows.
...
> > The shell wrapper (/usr/local/openoffice.org-2.2.1/program/soffice) is
> > definitely running soffice.bin.  But the binary does nothing except
> > return an exit value of 78, which is *not* trapped by the shell wrapper.
> > And I don't know what 78 means.
> 
> Try env OO_FORCE_DESKTOP=none

Set as an environment variable, that appears to make no difference.
Also tried with the variable OOO_FORCE_DESKTOP, which is mentioned in a
number of mailing list and forum posts for other operating systems.

But thanks for the suggestion.

Hrm, I just realized there's a freebsd-openoffice@ list.  Perhaps I'll
look there.

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>

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


Re: The worst error message in history belongs to... BIND9!

2007-07-03 Thread Paul Chvostek
On Mon, Jul 02, 2007 at 03:11:56PM -0500, Martin McCormick wrote:
> 
> #! /bin/sh
> a = 5
> 
> that's enough to make it happen. Run that, and you get:
> 
> a: not found
> 
>   Interestingly enough, if you run that same script in a
> Debian Linux environment, you get:
> 
> ./testfile: line 2: a: command not found

This is actually just the difference between sh and bash.  You'll see
the latter error if you type `a = 5` in bash in any OS.  It just so
happens that most Linux distributions don't have a real sh:

  [EMAIL PROTECTED] ~]$ uname -s
  Linux
  [EMAIL PROTECTED] ~]$ ls -l `which bash sh`
  -rwxr-xr-x  1 root root 616248 Aug 13  2006 /bin/bash
  lrwxrwxrwx  1 root root  4 Mar 25 20:36 /bin/sh -> bash


-- 
  Paul Chvostek <[EMAIL PROTECTED]>

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


OpenOffice.org 2.2.1 quits on launch

2007-07-03 Thread Paul Chvostek
Hiya.

I just did my Xorg upgrade, which included an upgrade of OpenOffice.org
to version 2.2.1.

Now, when I launch OO, it complains not at all, but opens no windows.
It doesn't take much time:

  > time openoffice.org-2.2.1
  0.727u 0.267s 0:02.06 47.5% 301+915k 1+0io 0pf+0w
  >

The shell wrapper (/usr/local/openoffice.org-2.2.1/program/soffice) is
definitely running soffice.bin.  But the binary does nothing except
return an exit value of 78, which is *not* trapped by the shell wrapper.
And I don't know what 78 means.

I've seen some hints in other operating systems' forums that OO does
strange things when fonts with questionable metrics are installed, so
I've uninstalled a bunch of things that I can probably do without, and
replaced the rest with `portupgrade -fR xorg-fonts-7.2`, to no avail.

Running soffice.bin in an strace produces gobs of output that I don't
know how to interpret.  The last few "useful" lines from strace refer to
libraries like libglib, libiconv, etc, so I've reinstalled glib2 and
libiconv and some others, also to no avail.

I'm in 6.1-RELEASE-p17.  Java (diablo-jdk1.5.0) works standalone, TTF
fonts work in other apps, and OO was built with these in /etc/make.conf:
  WITH_EVOLUTION2=yes
  WITH_TTF_BYTECODE_ENABLED=yes
  WITH_SYSTEM_FREETYPE=yes

Any suggestions?  Has anyone else seen and solved this?

Thanks.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>

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


Re: Firefox+Flash+Qemu

2006-09-18 Thread Paul Chvostek
> Jerry McAllister <[EMAIL PROTECTED]> wrote:
> 
> > Do you run Qemu on FreeBSD?   It says only 'LINUX host only' for "User
> > Mode Emulation".   So, does that mean I can emulate a full system if
> > I am hosting it under FreeBSD?

It's a proper virtual machine, not like jail(8).  Check
http://en.wikipedia.org/wiki/Comparison_of_virtual_machines for a list
of alternatives.

On Tue, Sep 19, 2006 at 04:01:01PM +1000, Norberto Meijome wrote:
>
> I've only used it for hosting a WinXP-Pro guest - it's not as fast as
> VMWare,but i'm switching to linux just for that reason. And i wont be buying
> vmware workstation linux licenses (needed for VmWare Workstaion 3.x on FreeBSD
> host) - my Wkstation-Windows licenses are just fine (but not valid for linux,
> according to vmware's support).

QEMU can read and write vmdk files, so you may have an easy migration
path.  But if your issue is speed, have you looked at the kqemu-kmod
port?  It's the bit that allows guest code to run directly on the host
cpu.  YMMV, but it seems to allow QEMU to run Windows guests at about
the same speed as VMWare.  http://qemu.org/qemu-accel.html for details.

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: Urgent: Downgrading from 6.X to 5.X?

2006-07-01 Thread Paul Chvostek
On Sun, Jul 02, 2006 at 01:10:29AM -0400, Francisco Reyes wrote:
> 
> Chad Leigh -- Shire.Net LLC writes:
> 
> >I don't remember general complaints about nfs in the 6.x series here  
> >in the list.
> 
> Checkt he stable list. :-)
> Locking issues on server during heavy load.
> Background fsck + NFSD locking issues
> Clients freeze if server goes away.. soft mount option doesn help.

I've had ongoing problems with a 5.4 box that does boatloads of file IO
both on NFS and local disk (doing weird things with 10 to 12 GB of
Apache logs daily).  NFS seems to go away for a few seconds (the filer
is unpingable), then return.  Despite the 5.x branch's known problems, I
had attributed this to the fact that I'm using  bge NICs.  I
moved most of this log processing to a 6.1-RELEASE box last week (on
identical hardware), and I've seen none of the timeouts.

Hardly scientific, but my $0.02 nonetheless

I'm using HP DL380-G4 servers (onboard bge, ciss RAID), with a BlueArc
Titan for NFS.  Of course, I'm not running nfsd on the FreeBSD boxes,
they're just clients.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: multiple links with single ln command

2006-06-27 Thread Paul Chvostek
Hiya.

On Tue, Jun 27, 2006 at 02:14:22PM -0400, sara lidgey wrote:
> 
> I've read the man page for ln but can't find a way to do this.  I want to 
> create multiple links to a single directory with one command.  Consider the 
> following example.  I have a directory structure like this:
> test/a/
> test/b/
> test/c/
>  I want to create a symbolic link called "clink" in test/a/ and test/b/ which 
> points to test/c/
> 
> The only way I know to do this is with two commands:
> ln -s test/c test/a/clink
> ln -s test/c test/b/clink
> 
> Can it be done with a single command?

No.  Well, it depends on what you consider a single command.  :)

Consider that your command line uses fileglob expansion to determine the
full command line *before* the command is run.  The notation you're
looking at is this:

ln [-fhinsv] source_file ... target_dir

which means the `ln` command takes a left-hand-side (the source,
possibly multiple sources) and a right-hand-side (the target).

But you're asking to go the other way around, with a single source being
created in multiple targets.  If you have ALOT of these links to make,
or need to do this on an regular basis, I suggest making a small script
that does what you want; perhaps something like this:

  #!/bin/sh
  if [ $# -lt 2 ]; then
echo "Usage: altln source_file target_dir ...
exit 1
  fi
  source_file="$1"; shift
  for target_dir in $*; do
ln -svi "$source_file" "$target_dir"
  done

... which you can run with a command line like:

# ls -F test/
a/  b/  c/
# altln ../c test/a test/b
# ls -l test/*/*
lrwxr-xr-x  1 root  wheel  4 Jun 27 17:28 test/a/c -> ../c
lrwxr-xr-x  1 root  wheel  4 Jun 27 17:28 test/b/c -> ../c
#

(Bear in mind that the symbolic link you create will be evaluated
relative to ITS location, not your cwd when you create the link.)

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: need help w/ simple bash script

2006-06-27 Thread Paul Chvostek
Hiya.

I've been working on a web front-end to aggregate multiple servers'
package update requirements as well.  I'll probably have it ready to
present in another few weeks, if ${DAYJOB} doesn't get in the way.

On Tue, Jun 27, 2006 at 08:01:49AM -0400, dw wrote:
> 
> # REPORT=`pkg_version -v`
> 
> But when I "echo $REPORT", I get:
> 
> Xaw3d-1.5E_1 = up-to-date with port apr-db42-1.2.7_1 = up-to-date with 
...
> When what I want is:
> 
> Xaw3d-1.5E_1 = up-to-date with port
> apr-db42-1.2.7_1 = up-to-date with port
...

Use more quotes.

  REPORT = "`pkg_version -v`"

will protect the newlines.

> for LINE in `pkg_version -v`; do echo $LINE; done

If you feel adventurous, you could to try something like this:

  tmpfile=/tmp/`basename $0`.$$
  trap "rm -f $tmpfile $tmpfile.?" 0 1 2 3 5 15
  pkg_version -v | while read package status text; do
echo "$package $text" >> $tmpfile."$status"
  done

Now you have tempfiles with package lists for the various stati, which
you can parse as you see fit.

Note that you may get better (i.e. more useful) mileage out of something
like:

  pkg_version -vL=

which will show you only what needs to be updated.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: Dual DVI, PCI-Express, xorg and FreeBSD

2006-06-27 Thread Paul Chvostek
On Mon, Jun 26, 2006 at 10:35:14AM -0700, Kelsey Cummings wrote:
> 
> Can anyone recommend a PCI Express graphics card with functional dual DVI
> output on FreeBSD for use with X to drive a pair of 1600x1200 displays?  I
> don't care at all about 3d performance.  Just something that works.

I just got a cheap MSI card:

http://www.msicomputer.com/product/p_spec.asp?model=NX7600GS-T2D256E&class=vga

Works fine on a pair of 1600x1200 LCDs with either of the nvidia drivers
available (default or from ports).  I'm not using its TV-out or any of
the crazy nvidia options, but the card definitely works.

$154 Cdn.  You can probably find it cheaper South of the border.

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: "dd" question

2006-05-04 Thread Paul Chvostek
On Wed, May 03, 2006 at 05:36:46PM -0500, Andrew wrote:
> On Wed, 2006-05-03 at 14:11 -0600, Chad Leigh -- Shire.Net LLC wrote:
> >  Can I used dd from my freebsd box to  
> > completely copy the whole disk, partition tables and all, to another  
> > disk?
...
> have another suggestion. If you think the disk will be ok, use dd to
> "zero-out" the rest of the drive; i.e.
...
> One of these days, I am going to write a tool to do just this sort of
> thing, since it seems to be a fairly common practice.

I believe that tool would be g4u, http://www.feyrer.de/g4u/, along with
the FAQ at http://www.feyrer.de/g4u/#shrinkimg .

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: Problem Piping iostat -c to awk!

2005-07-14 Thread Paul Chvostek
On Thu, Jul 14, 2005 at 11:43:39PM -0400, Hakim Singhji wrote:
> 
> | iostat -c 300 1 | awk '!/[a-zA-Z]|^$/ {print $1}'
> 
> This doesn't seem to work for me... awk tells me:
> 
> awk syntax error at source line 1
>   ***
> /[a: Event not found.

That's because you're using tcsh, and the exlcamation point is being
interpreted as part of a shell history reference.  You can turn this
into a shell *script*, or just run it in bash or /bin/sh.  Or if you
absolutely must run it in csh/tcsh, escape the ! with a \ (yes, even
inside single quotes).

> Not sure how to allow awk to delete two top rows of iostat... other that
> the grep option -v. Does not seem to be working in awk.

You could try something like:

 iostat -c 300 | awk 'BEGIN {getline;getline;} $1~/^[0-9]+$/ {print $1}'

or for something even lighter-weight:

 iostat -c 300 | sed -Ene 's/^ +//;s/ .*//;/^[0-9]+$/p'


-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: Un-GNOME-ing a FreeBSD box

2004-12-11 Thread Paul Chvostek
On Sat, Dec 11, 2004 at 06:54:18PM -0700, Brett Glass wrote:
>
> Which, by the way, is what the owner of the machine is seeing. He's
> listed the ports that were installed by running pkg_info, and is
> laboriously visiting each one's directory and trying to do a
> "make deinstall".

Perhaps you know this already, but you can probably get a good idea of
what all was installed during this event by looking of the timestamps of
directories inside /var/db/pkg/.  A dependency tree is vital in many
cases, but not so much in this one -- you basically just want the list,
without the ports that were already installed but may still be
dependencies of what was installed.

Once you have sanity-checked the list, just pkg_delete the whole batch,
all on a single command line.  If a dependency of something you're
deleting is also being deleted, pkg_delete should know not to complain.

> a clean, hierarchical tree but rather more of a "web". If there's
> a circular dependency, he's stuck.

Hence the value of dealing with these en masse rather than dependency by
dependency.  There should not be any circular dependencies in the ports
tree; that would be really awkward.

> Again, I really find it hard to believe that there would be no
provision
> for deleting a port AND the ports on which it depends cleanly. I tend
> to use a minimal number of ports and packages, and so didn't realize
> that this was such a difficult thing until now.

The problem is the age old one of unix assuming that if you do
something, it's because you wanted to do it.  There are lots of tricks
folks will tell you of how to back out, but none of them are guaranteed
to be clean, because what your friend did was simply a bad thing to do.
Dump compost in your living room, then find the "undo" key.

The ports system is designed to allow you to install and upgrade what
you need in order to make sure you can do what you want with your
system.  That kind of activity is *far* more common than cleaning up
messes like the one your friend has.  If more people dumped compost in
their living rooms, I'm sure carpet manufacturers, Dirt Devil, Hoover,
etc would come up with tools to help them back out of such a change to
their environment.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/

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


Re: 2 ISP on one FreeBSD router

2004-05-25 Thread Paul Chvostek
On Tue, May 25, 2004 at 12:44:04PM -0400, Chuck Swiger wrote:
> 
> Piotr Gnyp wrote:
> >My question is:
> >Is there a way to configure FreeBSD, so the NATed workstations will use
> >two ISP at once and in case of one ISP failure the whole traffic will be
> >put on one connection?
> 
> Sure, that's a standard multihoming scenario.
> Get an AS number (www.arin.net) and set up BGP peering with your ISPs.

That's a good answer, but not for this particular question.

Piotr, if your FreeBSD router has an Ethernet interface bound to the IP
assigned by each ISP, then the easiest way to transfer your NAT from one
ISP to the other is probably simply to kill the existing natd and re-run
it with a different -n option.  This *will* have the effect of taking
down your NAT for the transition period -- this is unavoidable.

You could achieve the transition with a simple shell script that would
ping the "active" connection, and if it fails, `killall natd`, wait for
the process to die, and re-launch with the different command line opts.

The exact mechanics are left as an exercise for the reader.  Or the
consultant he hires.  ;)

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/

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


Re: Can Freebsd run on linux?

2004-02-23 Thread Paul Chvostek

On Sun, Feb 22, 2004 at 03:49:10PM -0800, Ken Finegood's Office 2 wrote:
> Subject: Can Freebsd run on linux?

Yes, it can, but you'll likely need a product like VMWare to to it.

Questions about what software can run in Linux should probably be
directed to a Linux mailing list.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/

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


Re: Other ways than quotas to limit mail files size ??

2004-01-12 Thread Paul Chvostek
On Sun, Jan 11, 2004 at 09:24:28PM +0100, Greg Bernard wrote:
> 
> Is there another way to limit the amount of space occupied by mail files on
> a per user basis using another method than quotas ?
> 
> I would like to limit the amount of space available for each user's e.mail
> so e.mail file size will not go crazy.

What exactly do you want to do?

Filesystem quotas will cause a bounce message to be returned to the
sender indicating that the recipient was over quota.  That's generally
the preferred way because the operating system takes care of most of it.
You could modify that bounce message to include "friendlier" text if the
default text is a problem for you.

Alternately, you could implement a solution using procmail, with a small
tool like http://www.it.ca/software/fsizecompare.c to determine existing
filesize and behave accordingly.  Or you could come up with other clever
behaviour based on whatever criteria you dream up.

But you have to dream it up first.  Figure out exactly what you want to
do with your users' mail.  Then try to write something that does it.
And if you have problems with that, come back to the list and ask for
advice.  :-)

p

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: CVSupping 5

2003-08-05 Thread Paul Chvostek

Man, I'm behind on my list mail.

On Thu, Jul 03, 2003 at 02:31:22PM -0400, Bill Moran wrote:
> 
> Ian Barnes wrote:
> >
> >What is the cvsup tag for the 5 branch? RELENG_5 doesnt work.
> 
> RELENG_5_1 for the 5.1-RELEASE critical updates
> . for the bleeding-edge -CURRENT update (yes that's  a '.')
> 
> If you look in /usr/share/examples/cvsup there are several example cvsup
> files.  The one called 'standard-supfile' should get you -CURRENT.

I just did a 5.1 install from CD and shot myself in the foot because
/usr/share/examples/cvsup/stable-supfile has a default tag of RELENG_4
which I didn't see until after I had run a `make update`.  Presumably
this is an error and it should really be RELENG_5_1 (and ditto for 5.0,
which also defaulted to RELENG_4).

Lesson for the day: READ EVERYTHING.  ;-)

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/

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


Re: building a routing machine

2003-07-17 Thread Paul Chvostek
On Fri, Jul 18, 2003 at 03:56:53AM +, Frans-Jan v. Steenbeek wrote:
> 
> my webserver has two LAN-cards, my desktop has one. My question is: how
> do I connect these two with eachother so that both PC's can reach
> internet?
> 
> I've enabled routed on both systems, (-s on the webserver, -q on the
> desktop) but that doesn't seem to be enough. I've read something about
> routing and gateways in the handbook, but I didn't quite get it. So can
> anyone help me out?

You'd only use routing if each PC had a public IP address, and one
address was routed (upstream from your pair of machines) to the other.
If you have only one IP address, that address needs to be on the server
with two NICs, and you need to set up a *private* network for the
communication between your two machines.  You'll sort of turn your web
server into a firewall, rather than a router.

To connect to the Internet in general from your desktop, you'll probably
want to run natd.  The man page for natd should be your starting point.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: dual-homed problems

2003-07-08 Thread Paul Chvostek
On Tue, Jul 08, 2003 at 12:41:43PM -0400, Michael A. Smith wrote:
>
> rl0:  port 0x9200-0x92ff mem

Ugh...  I've never liked those cards.  I had two in a gateway a couple
of years ago -- the box spontaneously rebooted twice a week until I
replace them with fxp's, at which point the only thing to take it down
was a power supply fan

> rl0: interrupting at CIA irq 3

Ooh, the CIA is in your computer.

> Here's my /etc/rc.conf lines for the two NICs:
> ifconfig_dc0="inet 192.168.1.144  netmask 255.255.255.0"
> ifconfig_rl0="inet 192.168.1.145  netmask 255.255.255.0"

This is wrong.  When you assign IP addresses to interfaces, you give
them a subnet they know they can find on the Ethernet segment connected
to that interface.  Where should your computer send traffic for
192.168.1.100?  Out which interface?

> zeus# ifconfig rl0 inet 192.168.1.145 netmask 255.255.255.0
> ifconfig: ioctl (SIOCAIFADDR): File exists

This error occurs when FreeBSD tries to overwrite the routing info set
by the ifconfig statement for the first NIC.  Do a `netstat -rn` to see
relationships between subnets and interfaces.

> Any ideas for getting this NIC up and running properly??

Use a different IP network for it:

  ifconfig_dc0="inet 192.168.1.144  netmask 255.255.255.0"
  ifconfig_rl0="inet 192.168.2.1netmask 255.255.255.0"

Or use a smaller IP network for it:

  ifconfig_dc0="inet 192.168.1.144  netmask 255.255.255.0"
  ifconfig_rl0="inet 192.168.1.253  netmask 255.255.255.252"

But if 192.168.1.0/24 is in your routing table, its traffic goes out of
one, and only one, interface.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: problem upgrading from 5.0 to 5.1

2003-07-07 Thread Paul Chvostek
On Mon, Jul 07, 2003 at 01:38:59PM -0500, Michael L. Squires wrote:
> 
> > I've got a box on which 5.0-RELEASE was installed.  I updated the source
> > tree using cvsup to RELENG_5_1 and tried to recompile, and now every
> 
> RELENG_5_1 is compiling for me (as of 7/4).

Okay, but it's not for me.

> Are you running
> 
> mergemaster -p
> make buildworld

This is where it stops, while trying to compile bin/cat.  The pertinent
lines remain:

| /usr/obj/var/src/i386/usr/lib/libc.a(atexit.o): In function `atexit':
| atexit.o(.text+0xc7): undefined reference to `_pthread_mutex_unlock'
| atexit.o(.text+0xd8): undefined reference to `_pthread_mutex_lock'

I tried installing devel/pth from ports, to no avail (which makes sense;
the port wouldn't affect how libc.a has been compiled).

My /etc/make.conf includes:

  CPUTYPE=i686
  CFLAGS= -O3 -pipe
  COPTFLAGS= -O3 -pipe
  MAKE_IDEA=  YES # IDEA (128 bit symmetric encryption)
  COMPAT4X=   yes

Any further wisdom?

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/

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


problem upgrading from 5.0 to 5.1

2003-07-07 Thread Paul Chvostek

I'm confused...

I've got a box on which 5.0-RELEASE was installed.  I updated the source
tree using cvsup to RELENG_5_1 and tried to recompile, and now every
time it gets to bin/cat, it chokes.  The source tree *is* up to date,
I've tried running `make clean update buildworld` to no avail.  It
always stops in the same place.  I could do a proper reinstall from an
ISO, but I'd really like to know what's wrong.

Any idea what's happening, or where I should look?  I'm stumped.

Thanks.

| ===> bin
| ===> bin/cat
| cc -O3 -pipe -march=pentiumpro   -Wsystem-headers -Werror -Wall -Wno-format-y2k 
-Wno-uninitialized -Wformat=2 -Wno-format-extra-args -Werror  -c /var/src/bin/cat/cat.c
| cc -O3 -pipe -march=pentiumpro   -Wsystem-headers -Werror -Wall -Wno-format-y2k 
-Wno-uninitialized -Wformat=2 -Wno-format-extra-args -Werror   -static -o cat cat.o
| /usr/obj/var/src/i386/usr/lib/libc.a(atexit.o): In function `atexit':
| atexit.o(.text+0xc7): undefined reference to `_pthread_mutex_unlock'
| atexit.o(.text+0xd8): undefined reference to `_pthread_mutex_lock'
| atexit.o(.text+0xe8): undefined reference to `_pthread_mutex_unlock'
| atexit.o(.text+0x109): undefined reference to `_pthread_mutex_lock'
| atexit.o(.text+0x11a): undefined reference to `_pthread_mutex_unlock'
| atexit.o(.text+0x141): undefined reference to `_pthread_mutex_lock'
| /usr/obj/var/src/i386/usr/lib/libc.a(_flock_stub.o): In function `flockfile':
| _flock_stub.o(.text+0x10): undefined reference to `_pthread_self'
| _flock_stub.o(.text+0x25): undefined reference to `_pthread_mutex_lock'
| /usr/obj/var/src/i386/usr/lib/libc.a(_flock_stub.o): In function `_flockfile_debug':
| _flock_stub.o(.text+0x60): undefined reference to `_pthread_self'
| _flock_stub.o(.text+0x75): undefined reference to `_pthread_mutex_lock'
| /usr/obj/var/src/i386/usr/lib/libc.a(_flock_stub.o): In function `ftrylockfile':
| _flock_stub.o(.text+0xb5): undefined reference to `_pthread_self'
| _flock_stub.o(.text+0xca): undefined reference to `_pthread_mutex_trylock'
| /usr/obj/var/src/i386/usr/lib/libc.a(_flock_stub.o): In function `funlockfile':
| _flock_stub.o(.text+0x10d): undefined reference to `_pthread_self'
| _flock_stub.o(.text+0x149): undefined reference to `_pthread_mutex_unlock'
| *** Error code 1
| 
| Stop in /var/src/bin/cat.
|...

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/

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


Re: vi

2003-07-04 Thread Paul Chvostek
On Sat, Jul 05, 2003 at 12:15:06AM +0800, adrian kok wrote:
>
> Can I avoid this warning message from vi?
> When I run "vi  Vim: Warning: Input is not from a terminal

The man page for vi says:

   Vi is a screen oriented text editor.  Ex is a line-oriented text edi-
   tor.  Ex and vi are different interfaces to the same program, ...

VI is a VIsual editor.  If you have commands you'd like to execute on
stdin, try using ex.  If your stdin uses commands that exist in vim but
not in ex, I'd recommend rewriting your stdin....

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


List friendliness

2003-07-04 Thread Paul Chvostek

Alex,

On Thu, Jul 03, 2003 at 12:59:23AM +0200, Alex de Kruijff wrote:
> 
> I feel the following things are helpfull sending to 
> these list:
> 1. Do send mail like this with a cc to the orginal list.
>Others can learn from our exange of information.

You can encourage people to reply back to the list by including a
Reply-To line in your headers, as I've done with this message.  Some
list software will filter the header, but a Reply-To in the copy of the
message that's sent directly to someone will probably be respected by
their mail client.

Since you use mutt, you might find the following .muttrc lines helpful:

  lists freebsd-questions freebsd-current freebsd-chat
  send-hook [EMAIL PROTECTED] 'my_hdr Reply-To: [EMAIL PROTECTED]'
  send-hook [EMAIL PROTECTED]   'my_hdr Reply-To: [EMAIL PROTECTED]'
  send-hook [EMAIL PROTECTED]  'my_hdr Reply-To: [EMAIL PROTECTED]'
  ... etc.

This way, you can use the 'L' key to follow up to the list, the 'g' key
to do a group-reply, or the 'r' key to reply just to the sender, and
your headers will include the custom Reply-To for 'L' and 'g'.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: Procmail Recipie For FreeBSD Lists?

2003-07-03 Thread Paul Chvostek
On Thu, Jul 03, 2003 at 02:26:49PM -0700, Drew Tomlinson wrote:
> >
> >   :0
> >   * ^List-Id:[^<]+ >   FreeBSD/$MATCH/
>
> Thanks for pointing out my oversight and all of the help so far.  I've
> added the "/" and now my recipe is:
>
> :0
> * ^List-Id:[^<]+ /Maildir/FreeBSD/$MATCH/

You're storing your Maildir in the root directory of the server?

> However I get these messages from the procmail log:
>
> procmail: Matched "test"
> procmail: Match on "^List-Id:[^<]+ procmail: Unable to treat as directory "/Maildir/FreeBSD/test"
> procmail: Assigning "LASTFOLDER=/Maildir/FreeBSD/test"
> procmail: Opening "/Maildir/FreeBSD/test"
> procmail: Error while writing to "/Maildir/FreeBSD/test"

It looks as if procmail doesn't have permissions to create directories
in the root directory of your server.  That's a Good Thing.

> I've tried without the leading "/", without the Maildir, and without
> "/Maildir/" but I keep getting the same type of error.  Maildir is owned
> by me and is mode 700.

That's the right mode, but think about where the directory is, and where
procmail wants to find out.  Look in the procmail documentation (manpage
for procmailrc) for variables like $DEFAULT, $MAILDIR, $HOME, etc.

> If the mailbox is specified  to  be an  MH  folder  or  maildir  folder,
> procmail will create the necessary directories if they don't exist,
> rather than treat  the  mailbox  as  a non-existent filename.
>
> I feel I am close.  Can anyone enlighten me and point out what I'm
> missing?

Remember that paths that start with a / are absolute, and all other
paths are relative to $MAILDIR.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: format of /etc/crontab?

2003-07-03 Thread Paul Chvostek
On Thu, Jul 03, 2003 at 01:54:36PM -0700, Rich Morin wrote:
>
> The crontab(5) man page, however, says nothing about any differences in
> the file formats.  Instead, it appears to describe only the format that
> is used in /var/cron/tabs/* files.
>
> I would like to know precisely how the format of /etc/crontab differs,
> but I can't find any man page that addresses this.  Help?

The /etc/crontab is largely self-documenting.  It is similar to the
format of the other crontab files, and includes a comment line:

#minute hourmdaymonth   wdaywho command

What further information do you need?

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/

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


Re: Procmail Recipie For FreeBSD Lists?

2003-07-03 Thread Paul Chvostek
On Thu, Jul 03, 2003 at 10:12:22AM -0700, Drew Tomlinson wrote:
> 
> :0:
> * ^List-Id:[^<]+ Maildir/FreeBSD/$MATCH/new
> 
> And I'm getting messages like this in my procmail log:
> 
> procmail: Assigning "PATH=/home/drew/bin:/bin:/usr/bin:/usr/local/bin"
> procmail: Lock failure on "Maildir/FreeBSD/alpha/new.lock"
> procmail: Error while writing to "Maildir/FreeBSD/alpha/new"
> 
> OK, I assume the error is because Maildir/FreeBSD/alpha/new does not
> exist.  How can I get procmail to create the directory it needs?

As you no doubt read on the procmail manpage:

|  If the mailbox name ends  in  "/",  then  this
|  directory  is presumed to be a maildir folder; i.e., proc-
|  mail will deliver the message to a file in a  subdirectory
|  named  "tmp"  and  rename  it  to be inside a subdirectory
|  named "new".

Now ... I obviously don't use maildir format, but to me, this would
imply a format something like:

  :0
  * ^List-Id:[^<]+
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: Adding disk space to an FTP directory -- ideas?

2003-07-03 Thread Paul Chvostek

On Thu, Jul 03, 2003 at 11:09:28AM -0500, Greg Brooks wrote:
> 
> I currently use most of /var for a depository of files that move in and
> out via FTP. /var runs on a secondary hard drive in the system, along
> with a partition called /storage that's currently empty.
> 
> Only one user ("ftpuser") has login rights to the ftp system, although
> it's not jailed with its own /bin directory, etc.

Do you really mean "jailed", or are you talking about the user being
"chrooted", as is normally done with ftp users?

> The question: How do I take the available space in /storage and make it
> available to the ftpuser? Adding a symlink to /storage within the FTP
> area doesn't seem to work.

You could try mount_null (or mount_nullfs in 5.x), though the man page
gives warnings about bugs.  Or you could simply mount the filespace in a
directory to which "ftpuser" has access.  Or you could create another
user with access to /storage.  Or you could use an FTP server that
supports directory aliases.  I don't know of one that does, but perhaps
some searching would find one.

For your reading pleasure, there's discussion of this for proftpd at
http://proftpd.linux.co.uk/localsite/Userguide/linked/chroot-symlinks.html

Lots of options.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: Procmail Recipie For FreeBSD Lists?

2003-07-03 Thread Paul Chvostek

Woops...

On Thu, Jul 03, 2003 at 12:12:46PM -0400, Paul Chvostek wrote:
> 
> Easy enough:
> 
>   :0:
>   * List-Id:[^<]+<\/freebsd-[^.]
>   $MATCH

That should have been:

   :0:
   * ^List-Id:[^<]+<\/freebsd-[^.]+
   $MATCH

But I'm sure everyone already knew that...  ;)

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: Procmail Recipie For FreeBSD Lists?

2003-07-03 Thread Paul Chvostek
On Thu, Jul 03, 2003 at 08:53:30AM -0700, Drew Tomlinson wrote:
>
> About a year or two ago, someone posted his recipe for sorting FreeBSD
> lists.  This particular one was nice in that it extracted the list name
> from the "From" line (I think) and then created the appropriate folder
> if it didn't exist.  So freebsd-questions list items were put in the
> 'questions' folder, freebsd-stable in the 'stable' folder, and so on.  I
> have search the archives for this post for the past two days but have
> been unsuccessful.  I've tried to write it myself but this is not my
> area of expertise.  Does anyone have such a recipe they are willing to
> share?

Easy enough:

  :0:
  * List-Id:[^<]+<\/freebsd-[^.]
  $MATCH

This will store each list in a folder prefixed by "freebsd-".  If you
want freebsd-questions to be stored in a folder named "questions", just
move the \/ (which marks the beginning of the MATCH variable) to after
the "freebsd-".

And if you want it to support other RFC2919-compliant lists (that is,
ones which include the "List-Id:" header), simply remove "freebsd-" from
the recipe.


-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


buffered fifo?

2003-06-12 Thread Paul Chvostek

Hi all.

I need to write a simple server that will take input and "do" stuff with
it as it comes in.  Server function is atomic-per-item, but I want to
have multiple clients submitting requests.  The submission rate averages
about 2 per day, sometimes many per second, often slower.  And to
make things fun, the server gets written in bash.  :-)

mkfifo is dandy for handling one-to-one relationships, but it forces the
submitter to block until the fifo's been cleared.  So if it takes the
server a minute to "do" stuff once in a while, the clients will all be
waiting, which is unacceptable.

The ideal solution would of course be something that allows many-to-many
client-server relationships; the ability to have N clients pop things on
to one end of the queue and M servers popping things off the other end,
servers blocking while they wait for input.  But I'd settle for single-
server-multiple-client (i.e. a single `tail -f fifo | while read line`
and dot-locking for the clients).

I don't care if data gets lost in a crash, but I'd really rather not get
into alot of programming.  Is there an elegant way to achieve any of
this in shell?

Thanks.  :)

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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


Re: portsentry

2003-01-29 Thread Paul Chvostek

Hi Phillip.

On Wed, Jan 29, 2003 at 02:03:03PM -0500, Phillip Smith wrote:
>
> What's the best way to start portsentry on reboot?

There doesn't seem to be one build by the port, so I wrote a
/usr/local/etc/rc.d/portsentry.sh that looks someting like this:

#!/bin/sh
case "$1" in
start)
[ -x /usr/local/bin/portsentry ] && /usr/local/bin/portsentry -tcp
echo -n " portsentry"
;;
stop)
killall portsentry
;;
esac


I've seen others punt and simply add "/usr/local/bin/portsentry -tcp" to
their /etc/rc.local.  It's not as SysV-compliant, but it works.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/


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



portmap running amok

2002-12-25 Thread Paul Chvostek

Infrequently ... that is, perhaps once every few weeks, my mail server
grinds to a halt.  The load average climbs into the hundreds, processes
start getting killed off, and all because something seems to want to
launch as many instances of portmap as it possibly can.  And for the
life o' me, I can't figure out what.

The box is currently running 4.7-STABLE, but it's been doing this off
and on since 4.4-RELEASE.  The box is not an NFS server, but it becomes
a client from time to time, and portmap and nfsiod are launched at
startup.  There are no NFS devices listed in /etc/fstab, there is no
/etc/exports and no other NFS-related daemons are running.  If I catch
things in time (and have a shell already open), I can usually recover
with `killall portmap`.  If I'm not around (which is usually the case),
the box will either grind to a halt requiring a console reset, or merely
spontaneously reboot.

I can see no other strange behaviour (or network traffic) going on with
this box -- aside from this problem, it behaves perfectly.

Does any of this sound familiar?  Where do I look for the problem?

Tnx.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>


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



umass0: CBI reset failed, STALLED (with Sony DCR-PC101)

2002-07-14 Thread Paul Chvostek


Using 4.5-RELEASE, I've got a Sony DCR-PC101 which can take still photos
and present 'em to a PC via USB.  The device appears to be supported by
umass(4), but I'm running in to odd errors when I plug the beasty in:

 Jul 15 00:21:00 play /kernel: umass0: Sony DSC Sony, rev 1.00/2.00, addr 2
 Jul 15 00:21:05 play /kernel: umass0: CBI reset failed, STALLED
 Jul 15 00:21:05 play /kernel: da1 at umass-sim0 bus 0 target 0 lun 0
 Jul 15 00:21:05 play /kernel: da1:  Removable Direct Access SCSI-0 device 
 Jul 15 00:21:05 play /kernel: da1: 150KB/s transfers
 Jul 15 00:21:05 play /kernel: da1: 7MB (15840 512 byte sectors: 0H 0S/T 0C)

And when I try to `mount -t msdos /dev/da1c /a`, I get:

 Jul 15 00:21:47 play /kernel: umass0: Unsupported RBC command 0x08
 Jul 15 00:21:47 play /kernel: da1: reading primary partition table: error reading 
fsbn 0

Now ... I know the USB uses two reset types, Port and Command Block.  Is
a "CBI reset" really a "Command Block Reset"?  Is the "CBI reset failed"
error an indication that FreeBSD's umass implementation is incompatible
with my camera?

(The camera works as expected under certain other non-Unix-like
operating systems.)

Are there significant changes to umass since 4.5-RELEASE?

Thanks for any advice

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever  +1 416 598-
  it.canada - hosting and development  http://www.it.ca/


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