Re: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote:
 Hello,
 I have a problem with my perl script with the command sed. Here is a
 example of my code:

Don't use system(sed ...) in Perl.  It's considered poor style, since
Perl can do the same without having to fork a shell/sed process.

 # Selecting the fast server
 print Using the server called $server;
 system(`/usr/bin/sed 's|\*default host=\(.*\)|\*default host=${server}|' 
 $standard_supfile  $standard_supfile.copy`);
 system('/bin/mv $standard_supfile.copy $standard_supfile');

Try using Perl only, instead of forking sed(1), like this:

,---
|
| #!/usr/bin/perl -Tw
|
| use strict;
|
| #
| # supfile_set_default_host($supfile, $newhost)
| #   Set the default host used by the supfile $supfile to the
| #   host name supplied as $newhost.
| #
|
| sub supfile_set_default_host($$);
| sub supfile_set_default_host($$)
| {
| my $tmpsupfile;
| my $supfile = shift;
| my $newhost = shift;
|
| if (!defined($supfile) || !defined($newhost)) {
| return undef;
| }
|
| $tmpsupfile = tmp- . $supfile;
| open(SUP, $supfile) or die $!;
| open(TMP,  $tmpsupfile) or die $!;
|
| my $line;
| while (defined($line = SUP)) {
| chomp $line;
| $line =~ s/^(\*[ \t]*default[ \t][ \t]*host[ \t]*=).*/$1${newhost}/;
| print TMP $line\n;
| }
| close(TMP) or die $!;
| close(SUP) or die $!;
| rename($tmpsupfile, $supfile) or die $!;
| return 1;
| }
|
| supfile_set_default_host('standard-supfile', 'cvsup.example.net');
|
`---

This is slightly more complex than forking a sed(1) utility run, but
it's easier to understand (at least it is for me).

A very brief run of the script seems to work here:

,---
|
| $ pwd
| /tmp
| $ cp /usr/share/examples/cvsup/standard-supfile .
| $ grep 'default host' standard-supfile
| *default host=CHANGE_THIS.FreeBSD.org
| $ perl -Tw supfile.pl
| $ grep 'default host' standard-supfile
| *default host=cvsup.keramida
| $
|
`---

- Giorgos

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


Re: Package management question

2007-04-08 Thread Garrett Cooper
Chris Kottaridis wrote:
 I need a little advise on FreeBSD package management, I am kind of new
 to the FreeBSD package management thing and so I am sure this is a very
 basic question.
 
 I just installed 6.2 and apparently it installed the mysql-client 5.0
 package. I want to get mysql up to 5.1 from the /usr/ports directory,
 figuring the most recent version in the ports directory is better. So, I
 built the mysql51 port and when it came time to do make install it
 complained that mysql 5.0 was already in place and I should delete it
 first:
 
 # make install
 ===  Installing for mysql-client-5.1.11

 ===  mysql-client-5.1.11 conflicts with installed package(s):
  mysql-client-5.0.27

  They install files into the same place.
  Please remove them first with pkg_delete(1).
 *** Error code 1

 Stop in /usr/ports/databases/mysql51-client.

 
 Fair enough, but when I look at the pkg_info for 5.0.27:
 
 $ pkg_info mysql-client-5.0.27
 Information for mysql-client-5.0.27:

 Comment:
 Multithreaded SQL database (client)


 Required by:
 koffice-1.5.2,2
 kde-3.5.4


 Description:
 MySQL is a very fast, multi-threaded, multi-user and robust SQL
 (Structured Query Language) database server.

 WWW: http://www.mysql.com/

 - Alex Dupre
 [EMAIL PROTECTED]
 
 
 And indeed pkg_delete doesn't allow me to delete the package due to the
 dependencies:
 
 # pkg_delete mysql-client-5.0.27
 pkg_delete: package 'mysql-client-5.0.27' is required by these other
 packages
 and may not be deinstalled:
 koffice-1.5.2,2
 kde-3.5.4
 
 So, is the right answer to use pkg_delete -f and force the delete and
 then install mysql 5.1 and hope that koffice and kde are OK with the
 change ?
 
 That seems a bit brutal, but I can't seem to find any kind of a
 pkg_update option.
 
 I really just want to get a mysql server on the machine, but the
 mysql51-server port complained there weas no mysql-51-client. I assume I
 can install the mysql50-server, but I might as well go with the latest
 and greatest if I can.
 
 Thanks
   Chris Kottaridis([EMAIL PROTECTED])

Try pkg_delete -f, instead of pkg_delete.

pkg_delete can be a bit terse and not (as) user friendly at times (as it
should be).

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


Re: script perl with sed command

2007-04-08 Thread Garrett Cooper
Giorgos Keramidas wrote:
 On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote:
 Hello,
 I have a problem with my perl script with the command sed. Here is a
 example of my code:
 
 Don't use system(sed ...) in Perl.  It's considered poor style, since
 Perl can do the same without having to fork a shell/sed process.
 
 # Selecting the fast server
 print Using the server called $server;
 system(`/usr/bin/sed 's|\*default host=\(.*\)|\*default host=${server}|' 
 $standard_supfile  $standard_supfile.copy`);
 system('/bin/mv $standard_supfile.copy $standard_supfile');
 
 Try using Perl only, instead of forking sed(1), like this:
 
 ,---
 |
 | #!/usr/bin/perl -Tw
 |
 | use strict;
 |
 | #
 | # supfile_set_default_host($supfile, $newhost)
 | #   Set the default host used by the supfile $supfile to the
 | #   host name supplied as $newhost.
 | #
 |
 | sub supfile_set_default_host($$);
 | sub supfile_set_default_host($$)
 | {
 | my $tmpsupfile;
 | my $supfile = shift;
 | my $newhost = shift;
 |
 | if (!defined($supfile) || !defined($newhost)) {
 | return undef;
 | }
 |
 | $tmpsupfile = tmp- . $supfile;
 | open(SUP, $supfile) or die $!;
 | open(TMP,  $tmpsupfile) or die $!;
 |
 | my $line;
 | while (defined($line = SUP)) {
 | chomp $line;
 | $line =~ s/^(\*[ \t]*default[ \t][ \t]*host[ \t]*=).*/$1${newhost}/;
 | print TMP $line\n;
 | }
 | close(TMP) or die $!;
 | close(SUP) or die $!;
 | rename($tmpsupfile, $supfile) or die $!;
 | return 1;
 | }
 |
 | supfile_set_default_host('standard-supfile', 'cvsup.example.net');
 |
 `---
 
 This is slightly more complex than forking a sed(1) utility run, but
 it's easier to understand (at least it is for me).
 
 A very brief run of the script seems to work here:
 
 ,---
 |
 | $ pwd
 | /tmp
 | $ cp /usr/share/examples/cvsup/standard-supfile .
 | $ grep 'default host' standard-supfile
 | *default host=CHANGE_THIS.FreeBSD.org
 | $ perl -Tw supfile.pl
 | $ grep 'default host' standard-supfile
 | *default host=cvsup.keramida
 | $
 |
 `---
 
 - Giorgos

Interesting. Is that old perl syntax (v4, etc)? Just curious because
most of the documentation and examples switched to:

sub supfile_set_default_host
{

syntax as opposed to:

sub supfile_set_default_host($$);

sub supfile_set_default_host($$);
{

partly for abbreviation's sake and because I think they moved the
meaning of $$ to the running PID of the script, correct?

I'm rather new to the Perl game though to be honest (been playing around
with Perl for only the past 3 years -- and in particular over the past
2~3 months), so my take on the language could be off.

Thanks for the history lesson in advance :),

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


tcl84 on FreeBSD 6.2 make error (new user)

2007-04-08 Thread Ben Madin

G'day all,

I'm sorry but I am new to FreeBSD, and I am not sure what tcl84 is, but 
when I tried to install gdal, using portmanager after many hours it told 
me that tcl84 had an error, so that was that.


when I went to ports/lang/tcl84 and tried make install clean it didn't 
work either.


there were lots of errors like 
/usr/ports/lang/tcl84/work/tcl8.4.14/unix/libtcl84.so: undefined 
reference to 'sin' (or 'cos' or 'tan')


so I'm guessing that there is some mathematical thing that it needs, but 
nearly every package I have tried to build from ports seems to require 
this tcl at some point, so my first few days of FreeBSD are not going as 
well as I hoped... after much documentation searching and googling etc, 
I come to this point for help (at least on how to get more help)


cheers

Ben

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


Re: tcl84 on FreeBSD 6.2 make error (new user)

2007-04-08 Thread Garrett Cooper
Ben Madin wrote:
 G'day all,
 
 I'm sorry but I am new to FreeBSD, and I am not sure what tcl84 is, but
 when I tried to install gdal, using portmanager after many hours it told
 me that tcl84 had an error, so that was that.
 
 when I went to ports/lang/tcl84 and tried make install clean it didn't
 work either.
 
 there were lots of errors like
 /usr/ports/lang/tcl84/work/tcl8.4.14/unix/libtcl84.so: undefined
 reference to 'sin' (or 'cos' or 'tan')
 
 so I'm guessing that there is some mathematical thing that it needs, but
 nearly every package I have tried to build from ports seems to require
 this tcl at some point, so my first few days of FreeBSD are not going as
 well as I hoped... after much documentation searching and googling etc,
 I come to this point for help (at least on how to get more help)
 
 cheers
 
 Ben

Could you provide the exact set of error messages please? If you're
running via and ssh shell in an X11 terminal of some kind (xterm,
rxterm, kterm, Gterminal, etc) on a unix machine you can simply
highlight the text, and paste in a mail window.

Otherwise, you can redirect the output from the stderr for the compile
to a file as follows..

For Bourne shells:
rm -Rf /full/path/to/stderr.log; make install
1/full/path/to/stderr.log 2/full/path/to/stderr.log

For C-shells:
rm -Rf /full/path/to/stderr.log; make install | tee
/full/path/to/stderr.log

.. then please post it to on a website (preferrable) or take only the
relevant messages near the error and reply with that in your next email.

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


Re: script perl with sed command

2007-04-08 Thread Josh Carroll

Interesting. Is that old perl syntax (v4, etc)? Just curious because
most of the documentation and examples switched to:


No, he's using a function prototype. In this particular case, he's
saying the supfile_set_default_host function will take two scalars as
arguments.

For more info:

perldoc perlsub

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


Re: Package management question

2007-04-08 Thread Andrew Pantyukhin

On 4/8/07, Chris Kottaridis [EMAIL PROTECTED] wrote:

I need a little advise on FreeBSD package management, I am kind of new
to the FreeBSD package management thing and so I am sure this is a very
basic question.

I just installed 6.2 and apparently it installed the mysql-client 5.0
package. I want to get mysql up to 5.1 from the /usr/ports directory,
figuring the most recent version in the ports directory is better. So, I
built the mysql51 port and when it came time to do make install it
complained that mysql 5.0 was already in place and I should delete it
first:

# make install
===  Installing for mysql-client-5.1.11

===  mysql-client-5.1.11 conflicts with installed package(s):
  mysql-client-5.0.27

  They install files into the same place.
  Please remove them first with pkg_delete(1).
*** Error code 1

Stop in /usr/ports/databases/mysql51-client.


Fair enough, but when I look at the pkg_info for 5.0.27:

$ pkg_info mysql-client-5.0.27
Information for mysql-client-5.0.27:

Comment:
Multithreaded SQL database (client)


Required by:
koffice-1.5.2,2
kde-3.5.4


Description:
MySQL is a very fast, multi-threaded, multi-user and robust SQL
(Structured Query Language) database server.

WWW: http://www.mysql.com/

- Alex Dupre
[EMAIL PROTECTED]


And indeed pkg_delete doesn't allow me to delete the package due to the
dependencies:

# pkg_delete mysql-client-5.0.27
pkg_delete: package 'mysql-client-5.0.27' is required by these other
packages
and may not be deinstalled:
koffice-1.5.2,2
kde-3.5.4

So, is the right answer to use pkg_delete -f and force the delete and
then install mysql 5.1 and hope that koffice and kde are OK with the
change ?

That seems a bit brutal, but I can't seem to find any kind of a
pkg_update option.

I really just want to get a mysql server on the machine, but the
mysql51-server port complained there weas no mysql-51-client. I assume I
can install the mysql50-server, but I might as well go with the latest
and greatest if I can.


mysql 5.1 is not ready for mainstream, AFAIK.

You can install ports-mgmt/portupgrade and then use
portupgrade -o databases/somenewport someoldport
to upgrade an installed port to another one.

pkg_delete -f oldport  cd newport  make install

works fine, but you loose all the dependencies (kde
won't depend on the newport).
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Broadcom BCM5721 Ethernet Not Recognized on 6.2-RELEASE

2007-04-08 Thread Björn König

[EMAIL PROTECTED] schrieb:


[EMAIL PROTECTED]:0:0:  class=0x02 card=0x165914e4 chip=0x165914e4 rev=
0x11 hdr=0x00
vendor   = 'Broadcom Corporation'
device   = 'BCM5750A1 NetXtreme Gigabit Ethernet PCI Express'
class= network
subclass = ethernet


Obviously your device is recognized and a driver has been attached. The 
name of the device is bge0 and ifconfig bge0 should show information 
about its current configuration.


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


Re: FreeMat 3.0 doesn't call functions and help

2007-04-08 Thread Thierry Thomas
Le Sam  7 avr 07 à 21:24:05 +0200, Vittorio De Martino [EMAIL PROTECTED]
 écrivait :
 Besides if I ask for the help on line (OR helpwin) the following error 
 messages pops up  
 
 The file modules.txt is missing from the directory  where I think help files 
 should be.
  
 I think I didn't configure something but I don't know what (the main.pdf 
 manual isn't that helpful as far as the installation is concerned).

I had forgotten about that, but I think that the first time I had
launched

FreeMat -i /usr/local/share/FreeMat-3.0

and then it uses QSettings to store this path persistently.

Could you please try it, and if it solves this problem, I'll add a post-
installation message?

Regards,
-- 
Th. Thomas.


pgpZFj8hc7yoZ.pgp
Description: PGP signature


Re: script perl with sed command

2007-04-08 Thread Olivier Regnier

Giorgos Keramidas a écrit :

On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote:
  

Hello,
I have a problem with my perl script with the command sed. Here is a
example of my code:



Don't use system(sed ...) in Perl.  It's considered poor style, since
Perl can do the same without having to fork a shell/sed process.

  

# Selecting the fast server
print Using the server called $server;
system(`/usr/bin/sed 's|\*default host=\(.*\)|\*default host=${server}|' 
$standard_supfile  $standard_supfile.copy`);

system('/bin/mv $standard_supfile.copy $standard_supfile');



Try using Perl only, instead of forking sed(1), like this:

,---
|
| #!/usr/bin/perl -Tw
|
| use strict;
|
| #
| # supfile_set_default_host($supfile, $newhost)
| #   Set the default host used by the supfile $supfile to the
| #   host name supplied as $newhost.
| #
|
| sub supfile_set_default_host($$);
| sub supfile_set_default_host($$)
| {
| my $tmpsupfile;
| my $supfile = shift;
| my $newhost = shift;
|
| if (!defined($supfile) || !defined($newhost)) {
| return undef;
| }
|
| $tmpsupfile = tmp- . $supfile;
| open(SUP, $supfile) or die $!;
| open(TMP,  $tmpsupfile) or die $!;
|
| my $line;
| while (defined($line = SUP)) {
| chomp $line;
| $line =~ s/^(\*[ \t]*default[ \t][ \t]*host[ \t]*=).*/$1${newhost}/;
| print TMP $line\n;
| }
| close(TMP) or die $!;
| close(SUP) or die $!;
| rename($tmpsupfile, $supfile) or die $!;
| return 1;
| }
|
| supfile_set_default_host('standard-supfile', 'cvsup.example.net');
|
`---

This is slightly more complex than forking a sed(1) utility run, but
it's easier to understand (at least it is for me).

A very brief run of the script seems to work here:

,---
|
| $ pwd
| /tmp
| $ cp /usr/share/examples/cvsup/standard-supfile .
| $ grep 'default host' standard-supfile
| *default host=CHANGE_THIS.FreeBSD.org
| $ perl -Tw supfile.pl
| $ grep 'default host' standard-supfile
| *default host=cvsup.keramida
| $
|
`---

- Giorgos

  
Hello and thanks for this perl script. I'm new in perl and when i test 
him, i have an error that says:

No such file or directory at myscript.pl line 18

line 18 = open(TMP,  $tmpsupfile) or die $!;

#!/usr/bin/perl -Tw

use strict;

#
# supfile_set_default_host($supfile, $newhost)
#   Set the default host used by the supfile $supfile to the
#   host name supplied as $newhost.
#

sub supfile_set_default_host($$);
sub supfile_set_default_host($$)
{
my $tmpsupfile;
my $supfile = /etc/standard-supfile;
my $newhost = cvsup.fr.freebsd.org;

if (!defined($supfile) || !defined($newhost)) {
return undef;
}

$tmpsupfile = tmp- . $supfile;
open(SUP, $supfile) or die $!;
open(TMP,  $tmpsupfile) or die $!;

my $line;
while (defined($line = SUP)) {
chomp $line;
$line =~ s/^(\*[ \t]*default[ \t][ \t]*host[ \t]*=).*/$1${newhost}/;
print TMP $line\n;
}
close(TMP) or die $!;
close(SUP) or die $!;
rename($tmpsupfile, $supfile) or die $!;
return 1;
}

supfile_set_default_host('standard-supfile', 'cvsup.example.net');


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


Re: Package management question

2007-04-08 Thread Gerard
On Sunday April 08, 2007 at 03:37:04 (AM) Andrew Pantyukhin wrote:


 mysql 5.1 is not ready for mainstream, AFAIK.
 
 You can install ports-mgmt/portupgrade and then use
 portupgrade -o databases/somenewport someoldport
 to upgrade an installed port to another one.
 
 pkg_delete -f oldport  cd newport  make install
 
 works fine, but you loose all the dependencies (kde
 won't depend on the newport).

1) Use 'pkg_delete -dfv name-of-port

2) Install the new port with portmanager

portmanager name-of-port -p -l

That will install the new port and properly correct all of the
dependencies on you machine that depend on the new port.

HTH

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


Re: Sysinstall does not install GENERIC kernel

2007-04-08 Thread roudoudou
Le Fri, 6 Apr 2007 15:28:40 +0400,
Belov, Sergey [EMAIL PROTECTED] a écrit :

 I found a strange problem while making automatic install disk from
 official iso 6.2-RELEASE.
 
 I've made a custom install.cfg:
 
 ##
 # This is the installation configuration file
 
 # Turn on extra debugging.
 debug=yes
 nonInteractive=yes
 
 # My host specific data
 hostname=testmachine
 domainname=test.com
 nameserver=192.168.50.10
 
 # Which installation device to use
 mediaSetCDROM
 
 # Select which distributions we want.
 #dists=base bin catpages info manpages ports prof
 dists=base catpages info manpages proflibs kernel
 distSetCustom
(...)
hi,
hit the same bug too with FreeBSD-6.1. To workaround this, i've just
added the distribution set GENERIC to dists (this value wasn't
mentionned on the sysinstall manpage by the way :-( )
So try with this:
dists=base GENERIC catpages info manpages proflibs kernel
distSetCustom


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


ip fast forward on 6.2

2007-04-08 Thread J.D. Bronson

Is it proper to enable 'ip fastforwarding' on 6.2 when running pf ?
I am attached to a cable modem (10MB speed) and only use DHCP.

I have a 6.2 machine thats being used as a router and of course ip 
forwarding is enabled...but when I try to enable ip fastfowarding, I 
see throughput drop or surge up/down whereas without this enabled, 
throughput is higher and more consistent.


I have to use both or forwarding of packets doesnt work.

Anyone have any comments on this good/bad?

-JD

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


Cloning

2007-04-08 Thread Richard Rice
Any ideas on cloning an IBM T60 Thinkpad with G4U (Ghost for You)? The
T60 comes with a recovery partition. First I killdisk the drive,
re-install Windows XP. Then I want to capture an image with G4U so that
I can clone other T60 machines. Is this possible with G4U? My present
imaging software, Imagecaster, fails.

Richard

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


perl/script and retval

2007-04-08 Thread Olivier Regnier

Hello,

I written a small script in sh :
# Downloading doc files
echo === Downloading doc files
/usr/bin/csup $doc_supfile
RETVAL=$?
if [ $RETVAL != 0 ]; then
   echo abort
   exit 0
fi

I want to rewritte this code in perl script.

my $retval=0;
my $doc_supfile=/etc/doc-supfile;

# Downloading doc files
print === Downloading doc files\n;
system(/usr/bin/csup $doc_supfile
if (! $retval) {
print abort;
exit;
}
I don't know what happened with retval but that doesn't work correctly.

Can you help me please ?

Thank you :)

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


Re: script perl with sed command

2007-04-08 Thread Garrett Cooper
Olivier Regnier wrote:
 Giorgos Keramidas a écrit :
 On 2007-04-07 17:31, Olivier Regnier [EMAIL PROTECTED] wrote:
  
 Hello,
 I have a problem with my perl script with the command sed. Here is a
 example of my code:
 

 Don't use system(sed ...) in Perl.  It's considered poor style, since
 Perl can do the same without having to fork a shell/sed process.

  
 # Selecting the fast server
 print Using the server called $server;
 system(`/usr/bin/sed 's|\*default host=\(.*\)|\*default
 host=${server}|' $standard_supfile  $standard_supfile.copy`);
 system('/bin/mv $standard_supfile.copy $standard_supfile');
 

 Try using Perl only, instead of forking sed(1), like this:

 ,---
 |
 | #!/usr/bin/perl -Tw
 |
 | use strict;
 |
 | #
 | # supfile_set_default_host($supfile, $newhost)
 | #   Set the default host used by the supfile $supfile to the
 | #   host name supplied as $newhost.
 | #
 |
 | sub supfile_set_default_host($$);
 | sub supfile_set_default_host($$)
 | {
 | my $tmpsupfile;
 | my $supfile = shift;
 | my $newhost = shift;
 |
 | if (!defined($supfile) || !defined($newhost)) {
 | return undef;
 | }
 |
 | $tmpsupfile = tmp- . $supfile;
 | open(SUP, $supfile) or die $!;
 | open(TMP,  $tmpsupfile) or die $!;
 |
 | my $line;
 | while (defined($line = SUP)) {
 | chomp $line;
 | $line =~ s/^(\*[ \t]*default[ \t][ \t]*host[
 \t]*=).*/$1${newhost}/;
 | print TMP $line\n;
 | }
 | close(TMP) or die $!;
 | close(SUP) or die $!;
 | rename($tmpsupfile, $supfile) or die $!;
 | return 1;
 | }
 |
 | supfile_set_default_host('standard-supfile', 'cvsup.example.net');
 |
 `---

 This is slightly more complex than forking a sed(1) utility run, but
 it's easier to understand (at least it is for me).

 A very brief run of the script seems to work here:

 ,---
 |
 | $ pwd
 | /tmp
 | $ cp /usr/share/examples/cvsup/standard-supfile .
 | $ grep 'default host' standard-supfile
 | *default host=CHANGE_THIS.FreeBSD.org
 | $ perl -Tw supfile.pl
 | $ grep 'default host' standard-supfile
 | *default host=cvsup.keramida
 | $
 |
 `---

 - Giorgos

   
 Hello and thanks for this perl script. I'm new in perl and when i test
 him, i have an error that says:
 No such file or directory at myscript.pl line 18
 
 line 18 = open(TMP,  $tmpsupfile) or die $!;
 
 #!/usr/bin/perl -Tw
 
 use strict;
 
 #
 # supfile_set_default_host($supfile, $newhost)
 #   Set the default host used by the supfile $supfile to the
 #   host name supplied as $newhost.
 #
 
 sub supfile_set_default_host($$);
 sub supfile_set_default_host($$)
 {
 my $tmpsupfile;
 my $supfile = /etc/standard-supfile;
 my $newhost = cvsup.fr.freebsd.org;
 
 if (!defined($supfile) || !defined($newhost)) {
 return undef;
 }
 
 $tmpsupfile = tmp- . $supfile;
 open(SUP, $supfile) or die $!;
 open(TMP,  $tmpsupfile) or die $!;
 
 my $line;
 while (defined($line = SUP)) {
 chomp $line;
 $line =~ s/^(\*[ \t]*default[ \t][ \t]*host[
 \t]*=).*/$1${newhost}/;
 print TMP $line\n;
 }
 close(TMP) or die $!;
 close(SUP) or die $!;
 rename($tmpsupfile, $supfile) or die $!;
 return 1;
 }
 
 supfile_set_default_host('standard-supfile', 'cvsup.example.net');
 
 
 Thanks again for your help.

The file has to exist that you're trying to modify, otherwise it'll give
up :). Permissions issue?

Better to do that section may be:

 my $tmpsupfile;
 my $supfile = /etc/standard-supfile;
 my $newhost = cvsup.fr.freebsd.org;

 if (!defined($supfile) || !defined($newhost)) {
 return undef;
 }

 $tmpsupfile = new File::Temp();
 die $! unless(defined($tmpsupfile);
 open(SUP, $supfile) or die $!;


You need to add:

use File::Temp;

to the top of your script after use strict; though, and the Perl
module *should* be available with standard installations.

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


Strange makefile errors in multiple ports

2007-04-08 Thread Oliver Iberien
I seem to have messed something up somewhere, and peculiar instructions seem 
to have found their way in. An example is below:

---  Checking for the latest package of 'devel/gettext'
---  Fetching the package(s) for 'gettext-0.16.1' (devel/gettext)
---  Fetching gettext-0.16.1
/var/tmp/portupgradeJwjg3x7H/gettext-0.16.1.tb100% of 2093 kB  248 kBps
---  Downloaded as gettext-0.16.1.tbz
---  Identifying the package /var/tmp/portupgradeJwjg3x7H/gettext-0.16.1.tbz
---  Saved as /usr/ports/packages/All/gettext-0.16.1.tbz
---  Skipping libiconv-1.9.2_2 (already installed)
---  Found a package 
of 'devel/gettext': /usr/ports/packages/All/gettext-0.16.1.tbz 
(gettext-0.16.1)
---  Located a package version 0.16.1 
(/usr/ports/packages/All/gettext-0.16.1.tbz)
---  Upgrading 'gettext-0.14.5_2' to 'gettext-0.16.1' (devel/gettext) using a 
package
cd: can't cd to /usr/ports/multimedia/any2dvd
Makefile, line 54: Could not 
find /usr/ports/print/cups-lpr/../../print/cups/Makefile.common
make: fatal errors encountered -- cannot continue
^C---  Backing up the old version
---  Uninstalling the old version

The section

cd: can't cd to /usr/ports/multimedia/any2dvd
Makefile, line 54: Could not 
find /usr/ports/print/cups-lpr/../../print/cups/Makefile.common

appears often when installing both from packages and ports. I just stop it and 
the install continues. What could be going on here?

Thanks,

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


Re: perl/script and retval

2007-04-08 Thread Garrett Cooper
Olivier Regnier wrote:
 Hello,
 
 I written a small script in sh :
 # Downloading doc files
 echo === Downloading doc files
 /usr/bin/csup $doc_supfile
 RETVAL=$?
 if [ $RETVAL != 0 ]; then
echo abort
exit 0
 fi
 
 I want to rewritte this code in perl script.
 
 my $retval=0;
 my $doc_supfile=/etc/doc-supfile;
 
 # Downloading doc files
 print === Downloading doc files\n;
 system(/usr/bin/csup $doc_supfile
 if (! $retval) {
 print abort;
 exit;
 }
 I don't know what happened with retval but that doesn't work correctly.
 
 Can you help me please ?
 
 Thank you :)

Olivier,
Why are you doing this all in perl? Doesn't Bourne shell suffice :)?

Try:


#!/usr/local/bin/perl -w

use strict;

local $?=0;

my $doc_supfile=/etc/doc-supfile;
print === Downloading doc files\n;
system /usr/bin/csup $doc_supfile;

my $retval = $?; # make sure to grab exit val right after execution;
 # this can shoot you in the foot if you do it later on
 # down the line, and another command has been executed
 # behind the scenes.. Also read perldoc -f system for
 # more details on return codes because $retval doesn't
 # necessarily match the exit code that your shell may
 # see.

unless($retval) {
print CVsup aborted\n;
exit $retval;
}


See perldoc perlvar.

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


Re: Broadcom BCM5721 Ethernet Not Recognized on 6.2-RELEASE

2007-04-08 Thread alex

[EMAIL PROTECTED]:0:0:  class=0x02 card=0x165914e4 chip=0x165914e4 rev=
0x11 hdr=0x00
vendor   = 'Broadcom Corporation'
device   = 'BCM5750A1 NetXtreme Gigabit Ethernet PCI Express'
class= network
subclass = ethernet


Obviously your device is recognized and a driver has been attached. The
name of the device is bge0 and ifconfig bge0 should show information
about its current configuration.


This is just bizzare. When I wrote my initial e-mail, ifconfig -a did 
not show the bge0 device, nor would ifconfig bge0 pull up an 
interface; now the interface shows up with both of those.


The only thing I can think of is that I made nve0, the other interface, 
a statically configured address instead of one that used DHCP; other 
than that, I've done nothing that should have effected the Broadcom 
card.


In any case, I appreciate the e-mail, as I would not have even thought 
to look again without this prompting. Glad to have the card working!


Alex Kirk

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


bind9 in a jail

2007-04-08 Thread Jonathan Horne
i was setting up bind9 today in 2 jails.  1 jails is the master, and the other 
the slave.  i am reloading 2 machines that were previously physical machines, 
into these jails.  the master went fine, both internal and external views 
work as expected.

setting up the slave, was not so smooth.  i recovered my named.conf from 
backup, and then removed the external portion of the zones (i dont feel like 
messing with trouble invovlved with setting up the 2nd ip on the jail).  over 
the past few days while i was setting this up, the master was already in 
operation, and has had several edits to a few zones.  when i reloaded the 
slave versions from backup into my new slave, and started named, the slaved 
did not update their zonefiles to match the new serial numbers.i fixed 
this by stopping named, deleting the zone files, and restarting it again.  
thankfully, the slave zones all instantly populated, creating matching serial 
numbers to the ones that are running on the master.

do master-to-slave transfers work as expected in a jail, or did i just see 
some abnormal behavior (possibly due to me not waiting long enough for 
transfer to happen on its own)?

thanks,
-- 
Jonathan Horne
http://dfwlpiki.dfwlp.org
[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: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-08 11:40, Olivier Regnier [EMAIL PROTECTED] wrote:
 Giorgos Keramidas a ?crit :
 Try using Perl only, instead of forking sed(1), like this:
 
 ,---
 |
 | #!/usr/bin/perl -Tw
 |
 | use strict;
 |
 | #
 | # supfile_set_default_host($supfile, $newhost)
 | #   Set the default host used by the supfile $supfile to the
 | #   host name supplied as $newhost.
 | #
 |
 | sub supfile_set_default_host($$);
 | sub supfile_set_default_host($$)
 | {
 | my $tmpsupfile;
 | my $supfile = shift;
 | my $newhost = shift;
 |
 | if (!defined($supfile) || !defined($newhost)) {
 | return undef;
 | }
 |
 | $tmpsupfile = tmp- . $supfile;
 | open(SUP, $supfile) or die $!;
 | open(TMP,  $tmpsupfile) or die $!;
 |
 | my $line;
 | while (defined($line = SUP)) {
 | chomp $line;
 | $line =~ s/^(\*[ \t]*default[ \t][ \t]*host[ 
 \t]*=).*/$1${newhost}/;
 | print TMP $line\n;
 | }
 | close(TMP) or die $!;
 | close(SUP) or die $!;
 | rename($tmpsupfile, $supfile) or die $!;
 | return 1;
 | }
 |
 | supfile_set_default_host('standard-supfile', 'cvsup.example.net');
 |
 `---
 [...]

 Hello and thanks for this perl script. I'm new in perl and when i test
 him, i have an error that says:

 No such file or directory at myscript.pl line 18
 
 line 18 = open(TMP,  $tmpsupfile) or die $!;

Line 18 is not an open command, so something odd is happenning when you
copy/paste the script from your mailer.  Try downloading a copy of teh
script from:

http://people.freebsd.org/~keramida/files/supfile.perl

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


Re: advice on anti-spam tools

2007-04-08 Thread Erik Norgaard

Angelin Lalev wrote:
Hi List,   
  
My e-mail server is running the latest spamassassin with all of the blacklist enabled and etc. 
but I still receive over 20 spam messages a day (image spam mostly). 
The situation with other users may be worse.  That's why I was thinking about some tool that 
1. store incoming email
2. send request to the sender of the message, requiring to go to some address and enter the numbers (letters) 
from image

3. if the puzzle is solved in time (week or so) deliver the message, otherwise 
delete it.

Is there such tool(s) ?


I use grey listing and spamhaus xbl, no spamassasin or content analysis. 
Apart from grey listing and spamhaus, I block in my firewall IP ranges I 
have found un trustable, particular China and Korea, and ranges assigned 
dynamically, and I have some header analysis rules.


I get about 2 spam mails a day.

The earlier you can reject a message the less resources it takes, see 
how much you can reject on the envelope rather than data.


I have found that many spammers use my servers name or IP in HELO, so I 
reject that. Also, reject unresolvable domains etc, simple stuff.


Really, if you want to effectively address the problems, store all spam, 
create a spambox for users to forward their spam to. Analyse it every 
now and then. For example I did this to idenfity IP ranges sending spam.


With greylisting, I have found that greylisting 5 minutes will delay 
mail significantly and some mail will not be delivered. 3 minutes seems 
better.


Cheers, Erik
--
Ph: +34.666334818  web: http://www.locolomo.org


smime.p7s
Description: S/MIME Cryptographic Signature


Re: mail server blues

2007-04-08 Thread Apatewna

O/H Eric έγραψε:


qmail is horrible and outdated. heres a ton of reasons not to use it:


snip


But thats just my opinion! =)



I use qmail and I am happy with it, following a composition of what 
suits me best from the following sites:


a) http://www.freebsdrocks.net/ provides the basic walkthrough
b) http://qmail.jms1.net/ provides an all-in-one patch for qmail
c) various other sites about qmail and freebsd

I agree that qmail is horribly outdated and without the patch mention at 
(b) it would a no-brainer for me to follow. Just pick what fits your 
brain best and remember than when it breaks (and it will break), YOU 
will HAVE to fix it, nobody else.


--
RTFM and STFW before anything bad happens
_
Thanasis Rizoulis
Electronic Computing Systems Engineer
Larissa, Greece
FreeBSD/PCBSD user
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: mail server blues

2007-04-08 Thread adams
My company had a similar issue, we required a fairly turnkey solution for
e-mail. If you don't have the time/want to actually set it up your self, and
just want it to work I would suggest you try 

www.tnpi.net

I didn't do the installation myself, I paid Matt's group to do it. Other than
a few customization that we specifically required the default setup worked
very well.  If you like messing with mail, you can try to do it yourself with
the setup scripts.

..A
__
Powered By Techweavers Webmail
http://webmail.techweavers.net


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


Re: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-08 09:28, Garrett Cooper [EMAIL PROTECTED] wrote:
 Olivier Regnier wrote:
 The file has to exist that you're trying to modify, otherwise it'll give
 up :). Permissions issue?
 
 Better to do that section may be:
 
  my $tmpsupfile;
  my $supfile = /etc/standard-supfile;
  my $newhost = cvsup.fr.freebsd.org;
 
  if (!defined($supfile) || !defined($newhost)) {
  return undef;
  }
 
  $tmpsupfile = new File::Temp();
  die $! unless(defined($tmpsupfile);
  open(SUP, $supfile) or die $!;

Ah, much better, thanks :)

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


Automatic means for spinning down disks available?

2007-04-08 Thread Garrett Cooper
Hello again all,
I was wondering if there was an automatic, and possibly timed means to
spin down disks available in either ports or the base system, by chance.
Just trying to cut down on energy use, and increase my disks' lives :).
TIA,
-Garrett
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: script perl with sed command

2007-04-08 Thread Giorgos Keramidas
On 2007-04-08 00:26, Garrett Cooper [EMAIL PROTECTED] wrote:
 Giorgos Keramidas wrote:
  Try using Perl only, instead of forking sed(1), like this:
  [...]
  | sub supfile_set_default_host($$);
  | sub supfile_set_default_host($$)
  | {
[...]
 Interesting. Is that old perl syntax (v4, etc)? Just curious because
 most of the documentation and examples switched to:

 sub supfile_set_default_host
 {

 syntax as opposed to:

 sub supfile_set_default_host($$);

 sub supfile_set_default_host($$);
 {

That's actually a function prototype.  Prototypes are explained in:

man perlsub

in far more detail than I could ever describe in an email message :)

HTH,
Giorgos

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


Re: perl/script and retval

2007-04-08 Thread Giorgos Keramidas
On 2007-04-08 17:38, Olivier Regnier [EMAIL PROTECTED] wrote:
 Hello,

 I written a small script in sh :
 # Downloading doc files
 echo === Downloading doc files
 /usr/bin/csup $doc_supfile
 RETVAL=$?
 if [ $RETVAL != 0 ]; then
echo abort
exit 0
 fi

This script has a minor bug.  There is no != test for numeric values in
sh(1) scripts.  See below for a slightly larger shell script with some
reusable parts, which works probably better.

 I want to rewritte this code in perl script.

 my $retval=0;
 my $doc_supfile=/etc/doc-supfile;

 # Downloading doc files
 print === Downloading doc files\n;
 system(/usr/bin/csup $doc_supfile
 if (! $retval) {
 print abort;
 exit;
 }
 I don't know what happened with retval but that doesn't work correctly.

Missing quotes at the end of the system(... line?

In this case, it's quite easy to run the command in a simple shell
script.  WHy do you *have* to rewrite everything in Perl?  If it's
because you want to learn how something like this could be done in
Perl too, that's ok.  But it the reason is because Perl is faster,
Perl is safer, or some other similar 'optimization' related reason,
then just don't :)

A small shell script can go very far along the way, i.e.:

#!/bin/sh

msg()
{
echo === $*
}

err()
{
retval=$1
shift
echo 2 ERROR: $*
exit $retval
}

timestamp()
{
date '+%Y-%m-%d %H:%M:%S'
}

get_doc_files()
{
doc_supfile=$1
if [ -z ${doc_supfile} ]; then
err 1 no supfile for 'doc' collection
fi

msg Download of 'doc' collection started at `timestamp`
/usr/bin/csup $doc_supfile
msg Download of 'doc' collection finished at `timestamp`
}

get_doc_files /root/supfiles/doc-supfile
if [ $? -ne 0 ]; then
err 1 get_doc_files failed.
fi

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


Re: Skype can't connect.

2007-04-08 Thread Paris Jones


Doug Lee [EMAIL PROTECTED] wrote: On Sat, Apr 07, 2007 at 06:55:58PM -0700, 
Paris Jones wrote:
 // Weirdness, why did all the messages disappear?
 
 I would first like to say sorry Garret, my previous questions were not in good
 detail.

[recap of a problem often requoted recently on list]

I happen to be blind and so can't examine your .png files.  I also
happen to be a very regular user of Skype (though on Windows) and
FreeBSD (though an old version).

First question:  Why, after all the urging, do you not just try the
hw.snd.maxautovchans option and see what happens?  It doesn't take
long to do this, and certainly not as long as it takes to retype
your question with details. :)

But maybe you aren't aware that having multiple channels can, at
least afaik, allow device names like /dev/dsp0.0, /dev/dsp0.1, etc.
If just setting maxautovchans doesn't let you use the same device
name in both places, maybe you can use different ones after all.
But I still think you have to set maxautovchans.

Details from you remain below.

 FREEBSD 6.0 STABLE
 Using the linux_base-8 port.
 --I am using a USB headset, but have also tried one that plugs directly into 
 my  microphone and speaker slots on my computer.  Now, since my USB 
 headsetwill input sound from one device, and output from another, I am in a 
 little   problem. here is a picture of the options for headset in 
 the skype port:   
  http://www.arckeda.org/Skype_port.png
 
  As you can see, there is only one device I can use for my headset,
 (there is supposed to be a program called DSP highjacker for this, 
 but I would think that there would be a better way.)  Now, I  downloaded 
 the Linux static binary with QT compiled in from the skype website 
 (www.skype.com) and  tried it on my computer, if I go into the options in 
 that one, I see this:
 
  http://www.arckeda.org/Skype_native.png
 
  You may want to know why I am even writing this if I can just use the 
 Linux 
 Skype, well, I am writing this because the Linux build will not let me call
 anyone:  
 
  http://www.arckeda.org/Skype_native_cant_call.png
 
 It will just keep saying connecting, and nothing ever happens, I can 
 however see who is online at the moment:
 
  http://www.arckeda.org/Skype_native_can_see.png
 
 So, my question is, how can I either make the Skype port let me use 
 two  devices
 or, allow the Linux Skype to let me call people and receive calls.
 I think that about sums it up.
 
 Thank you.
 
   -ARCKEDA

-- 
Doug Lee [EMAIL PROTECTED]
SSB + BART Group [EMAIL PROTECTED]   http://www.ssbbartgroup.com
Innovation is hard to schedule. -- Dan Fylstra

 I have tried maxautovchans, I tried it the first time it was offered by 
 Garrett.

   -ARCKEDA


 
-
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Automatic means for spinning down disks available?

2007-04-08 Thread Yuri Grebenkin
Just wonder if it's better for an HDD not to spindown at all.
Maybe it's safer to spin in peace than to park/launch?
What do you think?

 Hello again all,
   I was wondering if there was an automatic, and possibly timed means to
 spin down disks available in either ports or the base system, by chance.
   Just trying to cut down on energy use, and increase my disks' lives :).
 TIA,
 -Garrett
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: advice on anti-spam tools

2007-04-08 Thread Martin Hudec

Angelin Lalev wrote:
My e-mail server is running the latest spamassassin with all of the blacklist enabled and etc. 
but I still receive over 20 spam messages a day (image spam mostly). 
The situation with other users may be worse.  That's why I was thinking about some tool that 
1. store incoming email
2. send request to the sender of the message, requiring to go to some address and enter the numbers (letters) 
from image

3. if the puzzle is solved in time (week or so) deliver the message, otherwise 
delete it.

Is there such tool(s) ?


As for image spam, it might be worthy to try out that mail/p5-FuzzyOcr 
as recommended by Kurt few days ago. I am considering to deploy it, as 
majority of the spam I am receiving is image one. Also check 
mail/spamass-rules_du_jour.


From my experience, simple setup of spamassassin, also feeding it with 
samples of 3800 spams and 3000 hams, and deployment of these rules du 
jour allowed me to get from (counted on per day basis) 314 spams to 8 
spams received to all of my 12 domains I have on my system, actually 
with two of those domains having some of their mail addresses spreaded 
widely on the net on various maillists etc. Data are statistical from 
January measurements, and though they might not be that much impressive 
in larger scale, they serve my purposes very well (getting to ~2.5% of 
the previous volume is quite fine for me). And one more thing, I do not 
have any greylisting at all, which would probably help the things even more.


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


Re: Automatic means for spinning down disks available?

2007-04-08 Thread Garrett Cooper
Yuri Grebenkin wrote:
 Just wonder if it's better for an HDD not to spindown at all.
 Maybe it's safer to spin in peace than to park/launch?
 What do you think?
 
 Hello again all,
  I was wondering if there was an automatic, and possibly timed means to
 spin down disks available in either ports or the base system, by chance.
  Just trying to cut down on energy use, and increase my disks' lives :).
 TIA,
 -Garrett

But I thought that disks keep on rotating, even when they're not being
accessed, unless you run {cam,ata}control stop.

That's similar to what Windows / MacOSX do at least.

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


Re: Package management question

2007-04-08 Thread Chris Kottaridis
Thanks.

Sounds like I should stick with Mysql 5.0 for now, But, it's good to
know about the portupgrade and portmanager commands. I wasn't aware of
them.

Thanks
Chris Kottaridis([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: perl/script and retval

2007-04-08 Thread Warren Block

On Sun, 8 Apr 2007, Olivier Regnier wrote:


my $retval=0;
my $doc_supfile=/etc/doc-supfile;

# Downloading doc files
print === Downloading doc files\n;
system(/usr/bin/csup $doc_supfile
if (! $retval) {
print abort;
exit;
}
I don't know what happened with retval but that doesn't work correctly.


Hint: does $retval have a return value assigned to it anywhere?

Even then, it may not work like you expect.  That is explained:

perldoc -f system

In general, 'perldoc -f functionname' is very useful.  Also, see

perldoc perlstyle

So that code section would be better (more Perlishly) done like this:

--
my $doc_supfile=/etc/doc-supfile;

# Downloading doc files
print === Downloading doc files\n;
system(/usr/bin/csup $doc_supfile) == 0 or die abort: $?\n;
--

-Warren Block * Rapid City, South Dakota USA
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Should sudo be used?

2007-04-08 Thread Andrew Pantyukhin

On 4/7/07, Kevin Kinsey [EMAIL PROTECTED] wrote:

Jerry McAllister wrote:
 Also, although telnet is a hole nowdays for logging in to a system with
 an id and password for the very reasons you have given,  it still has
 a use.   You can use it to easily poke at a port and check the response
 to see if something is up and working.   Of course, in that case you
 would probably not be sending an id and password, just some common
 handshaking strings that don't reveal any secrets to anyone.
 This is really a different issue from what was the OP or the intent
 of the wiki article, of course.

Right; the intent, as I see it, is to pound through people's (potential
new *BSD system admins) heads the fact that you don't use telnet for
remote logins/remote shell work.


Well actually, we're looking forward to telnet
start-tls RFC. It will provide for tighter
integration of PKI. I'll be glad to see the day
when all I need for authentication is TLS certs.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: input/output error on hd - resolved

2007-04-08 Thread Marty Landman

As a follow up to the previous thread on which I was the OP have followed
the advice given, contacted Ian Dowse who kindly walked me through fixing my
hard drive. Here is a synopsis as best as I can do to explain what was done:

First find out the offsets of the bad sectors, and check with dd that you
can't read them

Then write zeros over that sector

 dd if=/dev/zero seek=12345 count=1 of=/dev/ad1

and recheck that the original failing dd now works.

After fixing all the bad sectors that way, you'll probably have much
more luck with standard tools such as fsck.


%sudo fsck /dev/ad1s1a
** /dev/ad1s1a
Cannot find file system superblock
/dev/ad1s1a: INCOMPLETE LABEL: type 4.2BSD fsize 0, frag 0, cpg 0, size
490223412

Try editing the disklabel with `disklabel -e ad1s1', and changing the line
to look like:

  a: 49022341204.2BSD2048  16384 94088

%sudo fsck /dev/ad1s1a
** /dev/ad1s1a
Cannot find file system superblock

LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y

32 is not a file system superblock
28780512 is not a file system superblock
57560992 is not a file system superblock
[snip]
460486688 is not a file system superblock
489267168 is not a file system superblock
SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDED INFORMATION; SEE fsck(8).
%

looking for superblocks in the right place. What do you get if you
run the following - this is a crude way to search for superblocks:

 dd if=/dev/ad1 bs=32k | hd -v | grep 19 01 54 19


Better still, if you can get a hex dump
using dd and hd of a few kb before one of the matching lines, the
parameters can be extracted from there.



%sudo dd if=/dev/ad1 bs=32k | hd -v | grep 19 01 54 19
Password:
8b10  00 74 27 3d 19 01 54 19  75 31 8b 04 bd 9d 34 00

|.t'=..T.u14.|

8bd0  8b 4d 64 81 bd 5c 05 00  00 19 01 54 19 89 c6 89

|.Md..\.T|

0001c350  00 00 00 00 00 00 00 00  00 00 00 00 19 01 54 19

|..T.|

005ec350  00 00 00 00 00 00 00 00  00 00 00 00 19 01 54 19

|..T.|

0b7e0350  00 00 00 00 00 00 00 00  00 00 00 00 19 01 54 19

|..T.|

Looks good - the 3rd and later lines look like superblocks - try:

  fsck_ffs -b 160 /dev/ad1s1a

(160 is calculated by taking 0x0001c350 from the third line above,
subtracting 0x550 to get the start of the superblock, and then dividing
by 512 to get the sector number, and finally subtracting the partition
offset of 63)

I'm guessing that fsck was looking for superblocks in the wrong
place becasue without a valid superblock it was assuming that the
filesystem was UFS1 not UFS2. As far as I can tell, for UFS2 the
first standard backup superblock is usually at block 160, whereas
for UFS1 it's at block 32. I guess fsck_ffs and/or the man page
need to be updated to deal with that.

===

In end, it worked fine and that HD is back in business. Thanks Ian, and
everyone else that helped out on this one.

Marty

--
Web Installed Formmail - http://face2interface.com/formINSTal/
Webmaster's BBS - http://bbs.face2interface.com/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Automatic means for spinning down disks available?

2007-04-08 Thread Gary Kline
On Sun, Apr 08, 2007 at 10:10:17PM +0400, Yuri Grebenkin wrote:
 Just wonder if it's better for an HDD not to spindown at all.
 Maybe it's safer to spin in peace than to park/launch?
 What do you think?


My guess (really a SWAG) is that it's bettter to leave things
just happily spinning, 24*7.  In Nov, '99 a power off//on
destryed my new (105-day-old) 9G SCSI drive.  Off ffor fewer 
than five seconds, then a spike or two, and the drive went
deadder than a decade-old corpse.  Lost 10 months of files.
((Well, my tape backup had flubbed up.))  

Who would know???I've heard both sides, and so far, just 
leaving drive spin seems slightly better.  

{Futureistic[?] idea: maybe a new drive can have a mode of
 Full-Operation and (slower) Spin.  It wouldn't take more than
 a second to transition from the slow-spin to full-op mode.
 Open files, OS states, and whatever could be stored to RAM... .

 Any little old winemakers, er, diskmakers out there?
}

gary-the-thrifty

 
  Hello again all,
  I was wondering if there was an automatic, and possibly timed means to
  spin down disks available in either ports or the base system, by chance.
  Just trying to cut down on energy use, and increase my disks' lives :).
  TIA,
  -Garrett
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]

-- 
  Gary Kline  [EMAIL PROTECTED]   www.thought.org  Public Service Unix

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


Re: Automatic means for spinning down disks available?

2007-04-08 Thread Garrett Cooper

Gary Kline wrote:

On Sun, Apr 08, 2007 at 10:10:17PM +0400, Yuri Grebenkin wrote:
  

Just wonder if it's better for an HDD not to spindown at all.
Maybe it's safer to spin in peace than to park/launch?
What do you think?




My guess (really a SWAG) is that it's bettter to leave things
just happily spinning, 24*7.  In Nov, '99 a power off//on
	destryed my new (105-day-old) 9G SCSI drive.  Off ffor fewer 
	than five seconds, then a spike or two, and the drive went

deadder than a decade-old corpse.  Lost 10 months of files.
	((Well, my tape backup had flubbed up.))  

	Who would know???I've heard both sides, and so far, just 
	leaving drive spin seems slightly better.  


{Futureistic[?] idea: maybe a new drive can have a mode of
 Full-Operation and (slower) Spin.  It wouldn't take more than
 a second to transition from the slow-spin to full-op mode.
 Open files, OS states, and whatever could be stored to RAM... .

 Any little old winemakers, er, diskmakers out there?
}
  
Good point. The worst stress points during a disks life are at spin-up 
from what I've read.


Also, about the disk spinning at different speeds: many contemporary 
disks have acoustics levels where you can adjust the speed on demand 
(assuming you knew the hardware level instructions to send to the 
controllers). Unfortunately I don't know those settings, so I can't say 
what is and isn't possible.


The only upside is at least all disk makers seem to be amalgamating into 
either: Fujitsu, Hitachi, Quantum, Seagate, and WD, so figuring out the 
standards shouldn't be *too* hard =).


-Garrett


gary-the-thrifty

  

Hello again all,
I was wondering if there was an automatic, and possibly timed means to
spin down disks available in either ports or the base system, by chance.
Just trying to cut down on energy use, and increase my disks' lives :).
TIA,
-Garrett

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


Re: Automatic means for spinning down disks available?

2007-04-08 Thread Jonathan Horne
On Sunday 08 April 2007 18:11:51 Garrett Cooper wrote:
 Gary Kline wrote:
  On Sun, Apr 08, 2007 at 10:10:17PM +0400, Yuri Grebenkin wrote:
  Just wonder if it's better for an HDD not to spindown at all.
  Maybe it's safer to spin in peace than to park/launch?
  What do you think?
 
  My guess (really a SWAG) is that it's bettter to leave things
  just happily spinning, 24*7.  In Nov, '99 a power off//on
  destryed my new (105-day-old) 9G SCSI drive.  Off ffor fewer
  than five seconds, then a spike or two, and the drive went
  deadder than a decade-old corpse.  Lost 10 months of files.
  ((Well, my tape backup had flubbed up.))
 
  Who would know???I've heard both sides, and so far, just
  leaving drive spin seems slightly better.
 
  {Futureistic[?] idea: maybe a new drive can have a mode of
   Full-Operation and (slower) Spin.  It wouldn't take more than
   a second to transition from the slow-spin to full-op mode.
   Open files, OS states, and whatever could be stored to RAM... .
 
   Any little old winemakers, er, diskmakers out there?
  }

 Good point. The worst stress points during a disks life are at spin-up
 from what I've read.

 Also, about the disk spinning at different speeds: many contemporary
 disks have acoustics levels where you can adjust the speed on demand
 (assuming you knew the hardware level instructions to send to the
 controllers). Unfortunately I don't know those settings, so I can't say
 what is and isn't possible.

 The only upside is at least all disk makers seem to be amalgamating into
 either: Fujitsu, Hitachi, Quantum, Seagate, and WD, so figuring out the
 standards shouldn't be *too* hard =).

 -Garrett

  gary-the-thrifty
 
  Hello again all,
I was wondering if there was an automatic, and possibly timed means to
  spin down disks available in either ports or the base system, by
  chance. Just trying to cut down on energy use, and increase my disks'
  lives :). TIA,
  -Garrett

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

personally, my solution for solving the lower power consumption but still 
remotely available issue, by configuring Wake On Lan.  my web server is 
always on, so i just installed net/wakeonlan there.  simple lines in crontab 
wake all the rest of my hosts each morning (after im gone to the office of 
course) for backups, and then they all power themselves back down about 2 
hours later.  during the day, if i need to get to a system while im still 
remote, i just log into the webserver and wake it backup again.

i would agree that the greatest stress on a disk might just be while its 
turning on from cold... but with the warranties that seagate is offering 
these days, i feel bold enough to power them off/on at least once a day.

-- 
Jonathan Horne
http://dfwlpiki.dfwlp.org
[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: Automatic means for spinning down disks available?

2007-04-08 Thread Garrett Cooper

Jonathan Horne wrote:

On Sunday 08 April 2007 18:11:51 Garrett Cooper wrote:
  

Gary Kline wrote:


On Sun, Apr 08, 2007 at 10:10:17PM +0400, Yuri Grebenkin wrote:
  

Just wonder if it's better for an HDD not to spindown at all.
Maybe it's safer to spin in peace than to park/launch?
What do you think?


My guess (really a SWAG) is that it's bettter to leave things
just happily spinning, 24*7.  In Nov, '99 a power off//on
destryed my new (105-day-old) 9G SCSI drive.  Off ffor fewer
than five seconds, then a spike or two, and the drive went
deadder than a decade-old corpse.  Lost 10 months of files.
((Well, my tape backup had flubbed up.))

Who would know???I've heard both sides, and so far, just
leaving drive spin seems slightly better.

{Futureistic[?] idea: maybe a new drive can have a mode of
 Full-Operation and (slower) Spin.  It wouldn't take more than
 a second to transition from the slow-spin to full-op mode.
 Open files, OS states, and whatever could be stored to RAM... .

 Any little old winemakers, er, diskmakers out there?
}
  

Good point. The worst stress points during a disks life are at spin-up
from what I've read.

Also, about the disk spinning at different speeds: many contemporary
disks have acoustics levels where you can adjust the speed on demand
(assuming you knew the hardware level instructions to send to the
controllers). Unfortunately I don't know those settings, so I can't say
what is and isn't possible.

The only upside is at least all disk makers seem to be amalgamating into
either: Fujitsu, Hitachi, Quantum, Seagate, and WD, so figuring out the
standards shouldn't be *too* hard =).

-Garrett



gary-the-thrifty

  

Hello again all,
I was wondering if there was an automatic, and possibly timed means to
spin down disks available in either ports or the base system, by
chance. Just trying to cut down on energy use, and increase my disks'
lives :). TIA,
-Garrett
personally, my solution for solving the lower power consumption but still 
remotely available issue, by configuring Wake On Lan.  my web server is 
always on, so i just installed net/wakeonlan there.  simple lines in crontab 
wake all the rest of my hosts each morning (after im gone to the office of 
course) for backups, and then they all power themselves back down about 2 
hours later.  during the day, if i need to get to a system while im still 
remote, i just log into the webserver and wake it backup again.


i would agree that the greatest stress on a disk might just be while its 
turning on from cold... but with the warranties that seagate is offering 
these days, i feel bold enough to power them off/on at least once a day.
Well, I feel the same but only about WD's drives. Seagate's newer drives 
seem to die a lot more frequently than they used to (I've had 4 / 7 
Seagate drives die on me in the past few months and 1/6 WD drives die on 
me).


But then again that's my take on stuff :).

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


Re: Automatic means for spinning down disks available?

2007-04-08 Thread Gary Kline
On Sun, Apr 08, 2007 at 04:11:51PM -0700, Garrett Cooper wrote:
 Gary Kline wrote:
 On Sun, Apr 08, 2007 at 10:10:17PM +0400, Yuri Grebenkin wrote:
   
 Just wonder if it's better for an HDD not to spindown at all.
 Maybe it's safer to spin in peace than to park/launch?
 What do you think?
 
 
 
  My guess (really a SWAG) is that it's bettter to leave things
  just happily spinning, 24*7.  In Nov, '99 a power off//on
  destryed my new (105-day-old) 9G SCSI drive.  Off ffor fewer 
  than five seconds, then a spike or two, and the drive went
  deadder than a decade-old corpse.  Lost 10 months of files.
  ((Well, my tape backup had flubbed up.))  
 
  Who would know???I've heard both sides, and so far, just 
  leaving drive spin seems slightly better.  
 
  {Futureistic[?] idea: maybe a new drive can have a mode of
   Full-Operation and (slower) Spin.  It wouldn't take more than
   a second to transition from the slow-spin to full-op mode.
   Open files, OS states, and whatever could be stored to RAM... .
 
   Any little old winemakers, er, diskmakers out there?
  }
   
 Good point. The worst stress points during a disks life are at spin-up 
 from what I've read.

Hm.  Yep, that's what happpened with my 9G SCSI   it just 
kind of ground or dragged on startup.  After 3 tries, it was
kuput.

 
 Also, about the disk spinning at different speeds: many contemporary 
 disks have acoustics levels where you can adjust the speed on demand 
 (assuming you knew the hardware level instructions to send to the 
 controllers). Unfortunately I don't know those settings, so I can't say 
 what is and isn't possible.
 
 The only upside is at least all disk makers seem to be amalgamating into 
 either: Fujitsu, Hitachi, Quantum, Seagate, and WD, so figuring out the 
 standards shouldn't be *too* hard =).

Anyway, I like the idea of saving drives and power if a computer 
isn't active.  Else if everything can fit into RAM.  ...

gary


 
 -Garrett
 
  gary-the-thrifty
 
   
 Hello again all,
I was wondering if there was an automatic, and possibly timed means 
to
 spin down disks available in either ports or the base system, by chance.
Just trying to cut down on energy use, and increase my disks' lives 
:).
 TIA,
 -Garrett
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]

-- 
  Gary Kline  [EMAIL PROTECTED]   www.thought.org  Public Service Unix

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


Re: the art of pkgdb -F

2007-04-08 Thread Robert Huff
Michael P. Soulier writes:

  Might as well paint PLEASE KICK ME! and an arrow pointing
   down on your back 
  
  I'm used to binary-package distributions that seem to try a lot
  harder to not break. I suppose that ports is evolving, and it
  used to be worse, so I shouldn't complain. Still, if the handbook
  says to use portupgrade -R to upgrade a port, that's what BSD
  newbies like me are going to use.

Don't mistake me - I use portupgrade, and recommend it to
others.  But I know from bitter experience it is /not/ bullet-proof.


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


Re: Strange makefile errors in multiple ports

2007-04-08 Thread Kris Kennaway
On Sun, Apr 08, 2007 at 09:30:14AM -0700, Oliver Iberien wrote:
 I seem to have messed something up somewhere, and peculiar instructions seem 
 to have found their way in. An example is below:
 
 ---  Checking for the latest package of 'devel/gettext'
 ---  Fetching the package(s) for 'gettext-0.16.1' (devel/gettext)
 ---  Fetching gettext-0.16.1
 /var/tmp/portupgradeJwjg3x7H/gettext-0.16.1.tb100% of 2093 kB  248 kBps
 ---  Downloaded as gettext-0.16.1.tbz
 ---  Identifying the package /var/tmp/portupgradeJwjg3x7H/gettext-0.16.1.tbz
 ---  Saved as /usr/ports/packages/All/gettext-0.16.1.tbz
 ---  Skipping libiconv-1.9.2_2 (already installed)
 ---  Found a package 
 of 'devel/gettext': /usr/ports/packages/All/gettext-0.16.1.tbz 
 (gettext-0.16.1)
 ---  Located a package version 0.16.1 
 (/usr/ports/packages/All/gettext-0.16.1.tbz)
 ---  Upgrading 'gettext-0.14.5_2' to 'gettext-0.16.1' (devel/gettext) using 
 a 
 package
 cd: can't cd to /usr/ports/multimedia/any2dvd
 Makefile, line 54: Could not 
 find /usr/ports/print/cups-lpr/../../print/cups/Makefile.common
 make: fatal errors encountered -- cannot continue
 ^C---  Backing up the old version
 ---  Uninstalling the old version
 
 The section
 
 cd: can't cd to /usr/ports/multimedia/any2dvd
 Makefile, line 54: Could not 
 find /usr/ports/print/cups-lpr/../../print/cups/Makefile.common
 
 appears often when installing both from packages and ports. I just stop it 
 and 
 the install continues. What could be going on here?

Check carefully for local changes you made referring to this file (in
/usr/ports or /etc/make.conf, maybe elsewhere_.  It no longer exists
in the ports tree so it is unreferenced in a standard install of it.

Kris


pgpj3ZyaQxq0S.pgp
Description: PGP signature


Sysinstall does not install GENERIC kernel

2007-04-08 Thread Belov, Sergey

 hit the same bug too with FreeBSD-6.1. To workaround this, i've just
 added the distribution set GENERIC to dists (this value wasn't
 mentionned on the sysinstall manpage by the way :-( )
 So try with this:
 dists=base GENERIC catpages info manpages proflibs kernel
 distSetCustom

Thank you. I've also found interesting thread here:
http://lists.freebsd.org/pipermail/freebsd-questions/2006-June/123640.ht
ml

It seems that automatic installation mechanism is far from perfect and
there's nobody 
who interested in fixing the problems.

BTW, I've just selected distSetMinimum and in this case kernel was
istalled.
But except of this a problem I found a new trouble: system commands
which I've put in install.cfg 
doesn't seems to be executed. It just stops with the error 'system -1
command not found' 
or something like that.

Even when the commands are pretty simple like this: 
command=/sbin/shutdown -p now
system

It doesn't work and stops with the error.
How about your commands? Can you show some examples of your install.cfg
here if it works properly? :)

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