Re: [CentOS] Extract lines from text file

2012-08-15 Thread Marcelo Beckmann
Em 15-08-2012 11:22, Tony Molloy escreveu:
 
 Hi,
 
 I'm looking for a command to extract lines from a large text file, a 
 password file. A typical user has a username made from a letter 
 followed by their id-number.
 
 m9718508:pw:9301:840: Lynch  :/home/pgstud/m9718508:/bin/bash
 
 So for instance if I need to extract lines where;
 
 the 1st field, the username begins with an m
 and
 the 4th field, the group contains exactly 850
 
 cat passwdfile | grep ^m | grep 850  output
 
 is close but fails if the value 850 appears outside the 4th field. In 
 the above example which should be ignored 850 appears in the username 
 and home directory and is therefore extracted.
 
 Any ideas.


]$ cat testcentoslist
m9718508:pw:9301:840: Lynch  :/home/pgstud/m9718508:/bin/bash
m9718308:pw:9301:850: Lynch  :/home/pgstud/m9718508:/bin/bash
m9718208:pw:9301:840: Lynch  :/home/pgstud/m9718508:/bin/bash
m9718508:pw:9301:840: Lynch  :/home/pgstud/m9718908:/bin/bash

]$ cat testcentoslist | egrep ^m.*:.*:.*:850:
m9718308:pw:9301:850: Lynch  :/home/pgstud/m9718508:/bin/bash



-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] pvcreate limitations on big disks?

2012-05-23 Thread Marcelo Beckmann
Em 23-05-2012 16:24, Alan McKay escreveu:
 OK folks, I'm back at it again.  Instead of taking my J4400 ( 24 x 1T
 disks) and making a big RAID60 out of it which Linux cannot make a
 filesystem on, I'm created 4 x RAID6 which each are 3.64T
 
 I then do :
 
 sfdisk /dev/sd{b,c,d,e} EOF
 ,,8e
 EOF
 
 to make a big LVM partition on each one.
 
 But then when I do :
 
 pvcreate /dev/sd{b,c,d,e}1
 
 and then
 
 pvdisplay
 
 It shows each one as only half its actual size.

You need to use GPT partition table to manage above 2TB.
Traditional DOS partition can't manage above 2TB.
fdisk can't work with GPT, it's possible sfdisk don't work too.

Try using parted /dev/device, and
mklabel GPT


-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] yum with a proxy

2011-12-07 Thread Marcelo Beckmann
Em 07-12-2011 13:38, Philippe Naudin escreveu:

 Thanks for your answer : indeed, adding enabled=0 to fastestmirror.conf
 solves the problem.


If you want or need to use yum via proxy, you can put these lines in 
/etc/yum.conf:

proxy=http://IP_or_NAME:PORT/
proxy_username=username
proxy_password=password


Regards,
-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem with dates

2011-12-07 Thread Marcelo Beckmann
Em 07-12-2011 14:31, Weplica escreveu:

 Hello,

 I am instaling Horde on my CentOS 6, and when I do webmail-install I
 have a lots of this warnings:


 Warning: date(): It is not safe to rely on the system's timezone
 settings. You are *required* to use the date.timezone setting or the
 date_default_timezone_set() function. In case you used any of those
 methods and you are still getting this warning, you most likely
 misspelled the timezone identifier. We selected 'America/Lima' for
 'PET/-5.0/no DST' instead in /usr/share/pear/Horde/Log/Logger.php on
 line 182
snip

You can define a timezone in your /etc/php.ini to avoid these warnings, 
like:

date.timezone = America/Sao_Paulo

See this URL, it was useful for me when I saw these warning first time:
http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone


Regards,
-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem with dates

2011-12-07 Thread Marcelo Beckmann
Em 07-12-2011 14:55, Weplica escreveu:
 Thanks you, but the warning are on the shell while I am trying install
 Horde (I have more problems wiht the install) but do I need to fix
 this problems or I can install Horde and later fix the problem in
 php.ini if I have it?

In my case I saw these warnings after I have installed a mail server 
with roundcube webmail, then I did the fix later, with no more implications.

If you can fix now, it could be better to debug other problems, few 
error/warning logs to see.

Regards,
-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Where is source address info of a route kept?

2011-11-16 Thread Marcelo Beckmann
Em 16-11-2011 17:48, Dale Dellutri escreveu:
 I have an ethernet device in my lan with a primary address 192.168.5.205
 and a secondary address .217.  I added the secondary address after network
 startup established the primary address by an ip addr add command:

 # ip addr add 192.168.5.217/24 broadcast 192.168.5.255 dev eth0

 # ip addr show
 ...
 2: eth0:BROADCAST,MULTICAST,UP,LOWER_UP  mtu 1500 qdisc pfifo_fast qlen 1000
  link/ether 78:2b:cb:23:21:4c brd ff:ff:ff:ff:ff:ff
  inet 192.168.5.205/24 brd 192.168.5.255 scope global eth0
  inet 192.168.5.217/24 brd 192.168.5.255 scope global secondary eth0
  inet6 fe80::7a2b:cbff:fe23:214c/64 scope link
 valid_lft forever preferred_lft forever
 ...

 Then I add a new route via a network gateway but I want the route to use
 the secondary address as a source.

 # ip route add 11.11.11.11 via 192.168.5.148 src 192.168.5.217

 And the ip route show command shows that it knows the source.

 # ip route show
 11.11.11.11 via 192.168.5.148 dev eth0  src 192.168.5.217

 But where is the source address kept?  If I look at /proc/net/route,
 it shows the route (0B0B0B0B = 11.11.11.11), but not the source
 address.

 # cat /proc/net/route
 Iface Destination Gateway  Flags RefCnt Use Metric Mask MTU Window IRTT
 eth0  0B0B0B0B9405A8C0 0007  0  0   0   0   0  0
 ...

 Where is the source address kept?


ip route uses NETLINK to obtain info


I did:
strace -o /tmp/strace.out ip route show

and inside strace.out:
bind(3, {sa_family=AF_NETLINK, pid=0, groups=}, 12) = 0
sendto(3, \24\0\0\0\22\0\1\0031\25\304N\0\0\0\0\0\0\0\0, 20, 0, 
{sa_family=AF_NETLINK, pid=0, groups=}, 12) = 20
recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=}, 
msg_iov(1)=[{\364\0\0\0\20\0\2\0001\25\304N\\r\0\0\0\0\4\3\1\0\0\0I\0\1\0\0\0\0\0...,
 
16384}], msg_controllen=0, msg_flags=0}, 0) = 1688


You can see /proc/net/rt_cache, there is a Source column there.



-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Fried Email Server! Perl Problem

2011-10-18 Thread Marcelo Beckmann
Em 18-10-2011 18:16, Jack Fredrikson escreveu:
 I hate it when I crash my email server. Here's what tailing 
 /var/log/qmail/qmail-smtp/current gives me:

 [root@toast jack]# tail /var/log/qmail/qmail-smtpd/current
 @40004e9ddbd031610f54 tcpserver: status: 0/20
 @40004e9ddbd72c767c04 tcpserver: status: 1/20
 @40004e9ddbd72c7ab60c tcpserver: pid 12039 from 210.76.164.235
 @40004e9ddbd739a20d1c tcpserver: ok 12039 mail.toast.com:209.216.9.56:25 
 mail.cdfy-china.com:210.76.164.235::2804
 @40004e9ddbd81c826894 Can't load 
 '/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DB_File/DB_File.so' 
 for module DB_File: libdb-4.3.so: failed to map segment from shared object: 
 Cannot allocate memory at 
 /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/XSLoader.pm line 70.
 @40004e9ddbd81c827c1c  at 
 /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DB_File.pm line 251
 @40004e9ddbd81c828004 Compilation failed in require at 
 /var/qmail/bin/qmail-scanner-queue.pl line 480.
 @40004e9ddbd81c8287d4 BEGIN failed--compilation aborted at 
 /var/qmail/bin/qmail-scanner-queue.pl line 480.
snip

Hi,

I had a problem and saw log like this ('failed to map segment from 
shared object: Cannot allocate memory') when I setup a new qmail-toaster 
server on CentOS 6 some weeks ago.

In my case the problem was with submission service:
]# head /var/log/qmail/submission/current
@40004e8632f1279bcb1c tcpserver: status: 0/200
@40004e8c8d660a78233c tcpserver: status: 0/200
@40004e8cc0f40b7c931c tcpserver: status: 1/200
@40004e8cc0f40b7fd70c tcpserver: pid 20116 from 127.0.0.1
@40004e8cc0f40b809674 tcpserver: ok 20116 
mx.webers.com.br:127.0.0.1:587 :127.0.0.1::60821
@40004e8cc0f40b8dd514 /var/qmail/bin/qmail-smtpd: error while 
loading shared libraries: libselinux.so.1: failed to map segment from 
shared object: Cannot allocate memory


In my case, the solution was to increase memory, softlimit line on 
/var/qmail/supervise/submission/run:

exec /usr/bin/softlimit -m 6400 \ increse this value
 /usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c $MAXSMTPD \
 -u $QMAILDUID -g $NOFILESGID 0 587 \
 $SMTPD $VCHKPW /bin/true 21


Maybe it would be useful for your case too.


Best regards,
-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] CentOS 6.0 and 3ware 9650SE series RAID Performance

2011-09-01 Thread Marcelo Beckmann
Em 01-09-2011 17:41, Austin Godber escreveu:

 ===  tw_cli info c2  
 
 Unit  UnitType  Status %RCmpl  %V/I/M  Stripe  Size(GB)  Cache
  AVrfy
 --
 u0RAID-5OK -   -   64K 6519.19   OFF  
  OFF

I have the same controller on Centos 5.

Did you try to active Cache on 3ware?

[17:56:04 root@backup ~]# lspci | grep 3ware
01:00.0 RAID bus controller: 3ware Inc 9650SE SATA-II RAID PCIe (rev 01)
[17:56:11 root@backup ~]# tw_cli /c4 show

Unit  UnitType  Status %RCmpl  %V/I/M  Stripe  Size(GB)  Cache
AVrfy
--
u0RAID-5OK -   -   64K 5587.9RiW
ON


In the past I had a scenario where I started with Cache OFF and had a
poor performance, specially for write. After set Cache RiW I got better
performance.

I didn't test that controller on CentOS 6, but is good to know if there
is some problem, because my company sells equipment with that controller.


Best regards,

-- 
Marcelo Beckmann
Suporte Corporativo - supo...@webers.com.br
Webers Tecnologia - http://www.webers.com.br
Curitiba   (PR) (41) 3094-6600
Rio de Janeiro (RJ) (21) 4007-1207
São Paulo  (SP) (11) 4007-1207

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Finding wich files a writen to

2011-05-04 Thread Marcelo Beckmann
2011/5/4 Nicolas Ross rossnick-li...@cybercat.ca:
 Hi !

 I have a server (Centos 5) that is using a pair of SAS drives to store the
 data. (Mail server) They are on an adaptec raid controler with a battery
 backup and write back cache active.

 From time to time, I have sever peak io to those data disks ( 400 to 500
 iops,  70 to 100 megs/sec).

 With iostat, I find that it's almost a write i/o problem. How can I find to
 which files the OS writes ? On OSX boxes, there is a utility called fs_usage
 that can reports any disk activity for a particular process or all
 processes. Is there any utility like this on Centos ?

 iotop can points me to wich process, but that doesn't points me to what
 files are the culprits...

I sugest a look for tools like this
http://freshmeat.net/projects/fsniper

it helps to make a script to watch file activities, and it uses a kernel feature

I discovered inotify some months ago when I looked into every
initscript in init.d

[23:13:35 root@gw init.d]# cat /etc/redhat-release
CentOS release 5.3 (Final)
[23:13:45 root@gw init.d]# head restorecond
#!/bin/sh
#
# restorecond:  Daemon used to maintain path file context
#
# chkconfig:2345 12 87
# description:  restorecond uses inotify to look for creation of new files \
# listed in the /etc/selinux/restorecond.conf file, and restores the \
# correct security context.


more about inotify:
http://linux.die.net/man/7/inotify

http://www.linuxjournal.com/article/8478
What Is inotify?

inotify is a file change notification system—a kernel feature that
allows applications to request the monitoring of a set of files
against a list of events. When the event occurs, the application is
notified. To be useful, such a feature must be simple to use,
lightweight with little overhead and flexible. It should be easy to
add new watches and painless to receive notification of events.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos