Re: [CentOS] OT: Why VM?

2011-05-30 Thread John Doe
From: James B. Byrne 

> I have been working off and on with Xen and KVM on a couple of test
> hosts for that past year or so and while now everything seems to
> function as expected, more or less, I find myself asking the
> question: Why?

I saw a company architecture presentation where they had paired servers with 2 
VMs each + DRBD + heartbeat...
So, on each server there is an active VM and a 'backup' VM, crossed.
If one server goes down, the 'backup' VM on the second server would be 
activated.

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


Re: [CentOS] PHP Source

2011-05-30 Thread John Doe
From: Ron Young 
>I have a pressing need to compile a utility called odbtp into php on my new 64 
>bit machine with an AMD chip that is currently running CentOS 5.6.
>Where can I find the source files for the CentOS recommended versions of php.  
>I have searched the CentOS and related repository sites and can find php in 
>several places but not the source files.

Looked into SRPMS ?
Like: http://mirror.centos.org/centos/5/os/SRPMS/

JD

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


Re: [CentOS] SSD for Centos SWAP /tmp & /var/ partition

2011-05-30 Thread John Doe
From: Steve Clark 
> Unfortunately when I try it on SL 6.0 hdparm gets a segment 
> Hmmm sector still had random data after rm tmpfile and sync;


If SL 6.0 does not support it, I wonder if CentOS 6.0 (or even RH) will... 
damn.  :/

Guess you have no option to test it with the latest Fedora?

Anybody else could confirm that TRIM is working for them...?


JD

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


Re: [CentOS] local repo

2011-05-30 Thread Daniel Bird
On 27/05/2011 16:22, Jerry Geis wrote:
> Hi all,
>
> When I am installing I use kickstart and have a line like:
>  repo --name=Updates
> --baseurl=http://192.168.1.14/centos/5.6/updates/x86_64/
> and that works great for installing the OS.
>
> After that the machine reboots and I have it automatically go into
> additional installations running scripts.
> These installations do "yum install XXX".
> However, its no longer using my above repo its using the mirrorlist (as
> expected).
>
> My questions are :
>
> 1) I dont see a way in yum to say "use this repo to install", is there a
> way to point to my server in the office
> and dont do the mirrorlist.
>
> 2) Do I just drop a file called CentOS-office in the /etc/yum.repos.d
> directory
> that looks like this and it will be used first instead of the mirrorlist:
I do this in %post (along with installs for our standard extras)

wget -q -O - http://path/to/my/repo/file.repo | cat > 
/etc/yum.repos.d/CentOS-Base.repo

That way, when updates to centos-release happen I keep my config and end 
up with a CentOS-Base.repo.rpmnew which I can merge if required.

D

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


Re: [CentOS] PHP Source

2011-05-30 Thread Keith Roberts

On Mon, 30 May 2011, John Doe wrote:


To: CentOS mailing list 
From: John Doe 
Subject: Re: [CentOS] PHP Source

From: Ron Young 

I have a pressing need to compile a utility called odbtp into php on my new 64 
bit machine with an AMD chip that is currently running CentOS 5.6.
Where can I find the source files for the CentOS recommended versions of php.  
I have searched the CentOS and related repository sites and can find php in 
several places but not the source files.


Looked into SRPMS ?
Like: http://mirror.centos.org/centos/5/os/SRPMS/


Well I'm using the REMI repo version of php, and here are 
some links if it's any good to you.


Smart Package Manager will actually show you the repo URL, 
if you look under the Channel properties for a particular 
repo.


http://rpms.famillecollet.com/enterprise/5/remi/i386/

The SRPM's are here, but the php package is not quite in 
sync with the installed version.


http://rpms.famillecollet.com/SRPMS/php-5.3.6-3.remi.src.rpm

Installed Packages
Name   : php
Arch   : i386
Version: 5.3.3
Release: 1.el5.remi
Size   : 3.4 M
Repo   : installed
Summary: The PHP HTML-embedded scripting language.
   : (PHP: Hypertext Preprocessor)
URL: http://www.php.net/
License: PHP
Description: PHP is an HTML-embedded scripting language.


HTH

Keith Roberts

-
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] SSD for Centos SWAP /tmp & /var/ partition

2011-05-30 Thread Drew
> Hmmm sector still had random data after rm tmpfile and sync;
>
> /dev/sda3 on / type ext4 (rw,noatime,nodiratime,discard)
>
> Device Model: KINGSTON SS100S216G
> Serial Number:    16GB40013421
> Firmware Version: D100719
>
> Suppose to support TRIM.

Just so you know, in Jan '09 there was a thread on the linux raid list
where they discussed the TRIM command on SSD's. The gist of the
conversation (as I understood it) was that for SATA based SSD's, the
results of a raw read afterward were non-deterministic, ie you
couldn't be certain what you'd get back.


-- 
Drew

"Nothing in life is to be feared. It is only to be understood."
--Marie Curie

"This started out as a hobby and spun horribly out of control."
-Unknown
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] Getting the return value of the last command run

2011-05-30 Thread Dotan Cohen
All commands return a value, usually 0 if run properly. For instance, try:
$ ls && echo "done"
$ lsd && echo "done"

The echo command is only executed if the ls command exited
successfully. If one did not add the echo command with the && after a
command, how can he determine if the command exited successfully? I
have a particularly troubling script that gives does not mention if it
exits successfully or not. I could modify it (and probably will some
day) but in general I'd like to know the answer to this question as a
learning experience.

Thanks.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] OT: Why VM?

2011-05-30 Thread James B. Byrne
Thank you all for a most enlightening discussion.  I had not
considered using multiple VMs running on a central host to emulate
desktop workstations.  This application may be of considerable
benefit to us as we are constrained by our federal government to use
a Java based web app written so that it can only use the MicroSoft
Java VM, since discontinued.

Many of the other points made respecting VM employment were useful
to discover as well.

-- 
***  E-Mail is NOT a SECURE channel  ***
James B. Byrnemailto:byrn...@harte-lyne.ca
Harte & Lyne Limited  http://www.harte-lyne.ca
9 Brockley Drive  vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada  L8E 3C3

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


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Bob Beers
On Mon, May 30, 2011 at 10:38 AM, Dotan Cohen  wrote:
> All commands return a value, usually 0 if run properly. For instance, try:
> $ ls && echo "done"
> $ lsd && echo "done"
>
> The echo command is only executed if the ls command exited
> successfully. If one did not add the echo command with the && after a
> command, how can he determine if the command exited successfully?

You can check the return code.

$ ls
$ echo $?

0 (usually) indicates success.

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


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Christopher J. Buckley
Have a read up on using return codes in Bash.

http://tldp.org/LDP/abs/html/exit-status.html

Quick example:

#!/bin/bash

ls foobar

   if [ $? -eq 0 ] ; then
  echo "successful"
   else
  echo "not successful"
   fi

You get the idea..

Cheers,
Chris


On 30 May 2011 15:38, Dotan Cohen  wrote:

> All commands return a value, usually 0 if run properly. For instance, try:
> $ ls && echo "done"
> $ lsd && echo "done"
>
> The echo command is only executed if the ls command exited
> successfully. If one did not add the echo command with the && after a
> command, how can he determine if the command exited successfully? I
> have a particularly troubling script that gives does not mention if it
> exits successfully or not. I could modify it (and probably will some
> day) but in general I'd like to know the answer to this question as a
> learning experience.
>
> Thanks.
>
> --
> Dotan Cohen
>
> http://gibberish.co.il
> http://what-is-what.com
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
Kind Regards,
Christopher J. Buckley
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Dotan Cohen
On Mon, May 30, 2011 at 17:55, Bob Beers  wrote:
> You can check the return code.
>
> $ ls
> $ echo $?
>
> 0 (usually) indicates success.
>

Thank you Bob, that is exactly what I was looking for!



-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Keith Roberts
On Mon, 30 May 2011, Christopher J. Buckley wrote:

> To: CentOS mailing list 
> From: Christopher J. Buckley 
> Subject: Re: [CentOS] Getting the return value of the last command run
> 
> Have a read up on using return codes in Bash.
>
> http://tldp.org/LDP/abs/html/exit-status.html
>
> Quick example:
>
> #!/bin/bash
>
> ls foobar
>
>   if [ $? -eq 0 ] ; then
>  echo "successful"
>   else
>  echo "not successful"
>   fi
>
> You get the idea..
>
> Cheers,
> Chris

Excellent Bash tutorial and reference with loads of working 
examples. I whole-heartedly recommend it and there are 
different versions such as PDF format under:

http://tldp.org/LDP/abs/

Kind Regards,

Keith Roberts

-
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Ljubomir Ljubojevic
Dotan Cohen wrote:
> On Mon, May 30, 2011 at 17:55, Bob Beers  wrote:
>> You can check the return code.
>>
>> $ ls
>> $ echo $?
>>
>> 0 (usually) indicates success.
>>
> 
> Thank you Bob, that is exactly what I was looking for!
> 
> 
> 
Take notice that you can use $? *only* once. So if you ever need to 
reuse that status, you must first assign exit code to a variable and 
then evaluate variable.

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


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Dotan Cohen
On Mon, May 30, 2011 at 17:59, Christopher J. Buckley
 wrote:
> Have a read up on using return codes in Bash.
> http://tldp.org/LDP/abs/html/exit-status.html

Thanks, Chris, the link was very informative. I should spend more time
at the tldp site, I know.


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Dotan Cohen
On Mon, May 30, 2011 at 18:05, Ljubomir Ljubojevic  wrote:
> Take notice that you can use $? *only* once. So if you ever need to
> reuse that status, you must first assign exit code to a variable and
> then evaluate variable.
>

Actually, that was kink of obvious to me, but good thing that you
pointed it out. Thanks.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] OT: Why VM?

2011-05-30 Thread Ljubomir Ljubojevic
James B. Byrne wrote:
> Thank you all for a most enlightening discussion.  I had not
> considered using multiple VMs running on a central host to emulate
> desktop workstations.  This application may be of considerable
> benefit to us as we are constrained by our federal government to use
> a Java based web app written so that it can only use the MicroSoft
> Java VM, since discontinued.
> 
> Many of the other points made respecting VM employment were useful
> to discover as well.
> 
There was an patch to Terminal services for XP that allowed XP (Pro?) to 
accept more then 2 Remote desktop connections at the same time. 
http://www.kood.org/terminal-server-patch-21/

They used dll from beta version that allowed multiple connections. I 
guess you will not be able to use it (government, legal stuff and all), 
but if someone doesn't not have that problem, he could use it to run one 
XP instance on the server to allow multiple users to work on it.

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


Re: [CentOS] OT: Why VM?

2011-05-30 Thread Les Mikesell
On 5/30/11 9:40 AM, James B. Byrne wrote:
> Thank you all for a most enlightening discussion.  I had not
> considered using multiple VMs running on a central host to emulate
> desktop workstations.  This application may be of considerable
> benefit to us as we are constrained by our federal government to use
> a Java based web app written so that it can only use the MicroSoft
> Java VM, since discontinued.

For that scenario - or others where you need to run some oddball program under 
a 
different OS, you would also have the option of running the VM on the user's 
desktop or laptop.  VMware player or virtualbox might be the best way to run 
them where you want the display to be tied to the host.  You lose some of the 
advantages of central management but you can still roll them out and fix 
anything with a fresh copy of a master image.  Also note the advantage for 
software developers to have multiple OS versions easily available for testing 
under different platforms to avoid re-creating this locked-in situation.

-- 
   Les Mikesell
lesmikes...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] BIND9 - automatic zone definition replication to slave

2011-05-30 Thread Martin Šťastný
Hello,

I have simple question - is there a way to automatically replicate zone
definition (not zone itself - this is easy) to slave server using BIND9? Is
it BIND built-in or are there prebuilt scripts? Or I have to write that
script on my own (started by Cron, transfer file with zone names, create
conf file and finallly restart BIND?)?

Thank you in advance
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Robert Nichols
On 05/30/2011 10:00 AM, Dotan Cohen wrote:
> On Mon, May 30, 2011 at 17:55, Bob Beers  wrote:
>> You can check the return code.
>>
>> $ ls
>> $ echo $?
>>
>> 0 (usually) indicates success.
>>
>
> Thank you Bob, that is exactly what I was looking for!

And when you have several commands in a pipeline, the PIPESTATUS array
is your friend:

 $ true | false | false | true | true
 $ echo ${PIPESTATUS[*]}
 0 1 1 0 0

-- 
Bob Nichols "NOSPAM" is really part of my email address.
 Do NOT delete it.

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


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Stephen Harris
On Mon, May 30, 2011 at 11:24:19AM -0500, Robert Nichols wrote:
>  $ true | false | false | true | true
>  $ echo ${PIPESTATUS[*]}
>  0 1 1 0 0

Note that this is bash-ism; don't depend on it in a POSIX environment!

-- 

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


Re: [CentOS] Where is the Centos Linux 5.5 kernel syscall handler for mmap?

2011-05-30 Thread Keith Roberts
Hi. Sorry for the late reply, but I did not get the message 
that was archived.

I stumbled upon it here:

http://osdir.com/ml/centos/2011-05/msg01193.html

All I got was this message:

I am out of the office until 06/11/2011.

I will be out of the office starting 5/27/2011 and will not 
return until 6/12/2011. I will respond to your message when 
I return.

Note: This is an automated response to your message "CentOS 
Digest, Vol 76, Issue 28" sent on 5/28/2011 9:00:02 AM.

This is the only notification you will receive while this 
person is away.

In response to your question:

"Thank you for your suggestion about doing a grep of the 
source code. We found mmap.S in 
../sysdeps/unix/sysv/linux/i386. We looked in mmap.S and 
found a lot of assembly code. Could you please tell us if 
any of the assembly code call the kernel syscall handler 
for mmap.s?

Also, we ran make for the kernel Makefile and we obtained 
the following result shown below. Could you please suggest 
us how to fix the kernel Makeconfig so that it skips over 
libc_pic.os? Thank you for your help."

May I suggest you join the LKML?

http://www.kernel.org/pub/linux/docs/lkml/

I'm sure they are alot more knowledgeable concerning things 
like tweaking the internals of the Linux kernel.

HTH

Kind Regards,

Keith Roberts

-
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] Grep: show me this line and the next N lines?

2011-05-30 Thread Dotan Cohen
Can grep show the matching lines and the next N lines after a match?
For instance, I have a config file wit hthe following text:
[Tag h1]
foreground=#2e5a03
underline=double
indent=0
weight=PANGO_WEIGHT_BOLD
scale=2.25

I would ideally grep on "[Tag h1]" and have grep display the match and
the next 5 lines so that I see all the content of the h1 section.

Can this be done?

Thanks!

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Grep: show me this line and the next N lines?

2011-05-30 Thread Pintér Tibor
On 05/30/2011 11:08 PM, Dotan Cohen wrote:
> Can grep show the matching lines and the next N lines after a match?
> For instance, I have a config file wit hthe following text:
> [Tag h1]
> foreground=#2e5a03
> underline=double
> indent=0
> weight=PANGO_WEIGHT_BOLD
> scale=2.25
> 
> I would ideally grep on "[Tag h1]" and have grep display the match and
> the next 5 lines so that I see all the content of the h1 section.
> 
> Can this be done?
> 
> Thanks!
> 

man grep

hint: A

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


Re: [CentOS] Grep: show me this line and the next N lines?

2011-05-30 Thread Ljubomir Ljubojevic
Dotan Cohen wrote:
> Can grep show the matching lines and the next N lines after a match?
> For instance, I have a config file wit hthe following text:
> [Tag h1]
> foreground=#2e5a03
> underline=double
> indent=0
> weight=PANGO_WEIGHT_BOLD
> scale=2.25
> 
> I would ideally grep on "[Tag h1]" and have grep display the match and
> the next 5 lines so that I see all the content of the h1 section.
> 
> Can this be done?
> 
> Thanks!
> 
man grep says "-A 5" would give you matching line + 5 more.

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


Re: [CentOS] Grep: show me this line and the next N lines?

2011-05-30 Thread Meenoo Shivdasani
On Mon, May 30, 2011 at 5:08 PM, Dotan Cohen  wrote:

> Can grep show the matching lines and the next N lines after a match?
>


> I would ideally grep on "[Tag h1]" and have grep display the match and
> the next 5 lines so that I see all the content of the h1 section.
>

Try

grep -A 5 pattern filename

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


Re: [CentOS] Grep: show me this line and the next N lines?

2011-05-30 Thread John R. Dennison
On Tue, May 31, 2011 at 12:08:37AM +0300, Dotan Cohen wrote:
> 
> Can this be done?

"man grep" - I think you will be surprised when you take a look at it.




John
-- 
Worrying works.  About 90% of the things I worry about never happen.

-- Woody Paige (1946-), sports columnist, on ESPN's "Around the Horn"


pgpGXnB54K4BY.pgp
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] scheduling differences between CentOS 4 and CentOS 5?

2011-05-30 Thread Matt Garman
On Tue, May 24, 2011 at 02:22:12PM -0400, R P Herrold wrote:
> On Mon, 23 May 2011, Mag Gam wrote:
> 
> > I would like to confirm Matt's claim. I too experienced larger
> > latencies with Centos 5.x compared to 4.x. My application is very
> > network sensitive and its easy to prove using lat_tcp.
> 
> > Russ,
> > I am curious about identifying the problem. What tools do you
> > recommend to find where the latency is coming from in the application?
> 
> I went through the obvious candidates:
>   system calls
>   (loss of control of when if ever the
>   scheduler decides to let your process run again)

This is almost certainly what it is for us.  But in this situation,
these calls are limited to mutex operations and condition variable
signaling.

>   polling v select
>   polling is almost always a wrong approach when
>   latency reduction is in play
>   (reading and understanding: man 2 select_tut
>is time very well spent)

We are using select().  However, that is only for the networking
part (basically using select() to wait on data from a socket).
Here, my concern isn't with network latency---it's with "intra
process" latency.

>   choice of implementation language -- the issue here
>   being if one uses a scripting language, one cannot
>   'see' the time leaks

C/C++ here.

> Doing metrics permits both 'hot spot' analysis, and moves the 
> coding from 'guesstimation' to software engineering.  We use 
> graphviz, and gnuplot on the plain text 'CSV-style' timings 
> files to 'see' outliers and hotspots

We're basically doing that.  We pre-allocate a huge 2D array for
keeping "stopwatch" points throughout the program.  Each column
represents a different stopwatch point, and each row represents and
different iteration through these measured points.  After a lot of
iterations (usually at least 100k), the numbers are dumped to a file
for analysis.

Basically, the standard deviation from one iteration to the next is
fairly low.  It's not like there are a few outliers driving the
average intra-process latency up; it's just that, in general, going
from point A to point B takes longer with the newer kernels.

For what it's worth, I tried a 2.6.39 mainline kernel (from elrepo),
and the intra-process latencies get still worse.  It appears that
whatever changes are being made to the kernel, it's bad for our kind
of program.  I'm trying to figure out, from a conceptual level, what
those changes are.  I'm looking for an easier way to understand than
reading the kernel source and change history.  :)


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


Re: [CentOS] Grep: show me this line and the next N lines?

2011-05-30 Thread Dotan Cohen
Thanks, all. I did actually look at the grep manpage but after a few
screenfuls it became tl;dr and I started just skimming. I suppose that
I skimmed too fast!

Thanks!

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread fred smith
On Mon, May 30, 2011 at 05:38:56PM +0300, Dotan Cohen wrote:
> All commands return a value, usually 0 if run properly. For instance, try:
> $ ls && echo "done"
> $ lsd && echo "done"
> 
> The echo command is only executed if the ls command exited
> successfully. If one did not add the echo command with the && after a
> command, how can he determine if the command exited successfully? I
> have a particularly troubling script that gives does not mention if it
> exits successfully or not. I could modify it (and probably will some
> day) but in general I'd like to know the answer to this question as a
> learning experience.

Yes, all commands return a value UNLESS it was written by one of the
idi,... er, misguided programmers who thinks its ok to write (in 
C):

void main (void)
{
...
exit();
}

because, of course, in C main() always returns SOMETHING.

I'm sure it's the same in a bash script, even if the script doesn't
explicitly provide a return value I imagine the shell returns something
anyway, it's just that it's meaningless when that happens.

-- 
 Fred Smith -- fre...@fcshome.stoneham.ma.us -
   I can do all things through Christ 
  who strengthens me.
-- Philippians 4:13 ---
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Dotan Cohen
On Tue, May 31, 2011 at 01:14, fred smith  wrote:
> Yes, all commands return a value UNLESS it was written by one of the
> idi,... er, misguided programmers who thinks its ok to write (in
> C):
>
> void main (void)
>        {
>        ...
>        exit();
>        }
>
> because, of course, in C main() always returns SOMETHING.
>
> I'm sure it's the same in a bash script, even if the script doesn't
> explicitly provide a return value I imagine the shell returns something
> anyway, it's just that it's meaningless when that happens.
>

I also learned in C that main should be an int. Now that I'm studying
Java, main is always a void and nobody has been able to explain to me
why.

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Grep: show me this line and the next N lines?

2011-05-30 Thread John R. Dennison
On Tue, May 31, 2011 at 01:10:40AM +0300, Dotan Cohen wrote:
> Thanks, all. I did actually look at the grep manpage but after a few
> screenfuls it became tl;dr and I started just skimming. I suppose that
> I skimmed too fast!

Um

It's the first option described.




John
-- 
Mankind is a single body and each nation a part of that body.  We must
never say "What does it matter to me if some part of the world is ailing?"
If there is such an illness, we must concern ourselves with it as though we
were having that illness.

Mustafa Kemal Ataturk (1881-1938), founder and first President of the
Republic of Turkey


pgpjt7fYyvO3I.pgp
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] BIND9 - automatic zone definition replication to slave

2011-05-30 Thread Nicolas Ross

> I have simple question - is there a way to automatically replicate zone 
> definition (not zone itself - this is easy) to slave server using BIND9? Is 
> it BIND built-in or are there prebuilt scripts? Or I have to write that 
> script on my own (started by Cron, transfer file with zone names, create conf 
> file and finallly restart BIND?)?

Here, I have made a php front-end to manage dns zones and entries.

So for the slaves, it's only a little php script that connects to the same 
database and fetches the zone names to build the conf file...
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Getting the return value of the last command run

2011-05-30 Thread Robert Nichols
On 05/30/2011 05:14 PM, fred smith wrote:
> Yes, all commands return a value UNLESS it was written by one of the
> idi,... er, misguided programmers who thinks its ok to write (in
> C):
>
> void main (void)
>   {
>   ...
>   exit();
>   }
>
> because, of course, in C main() always returns SOMETHING.
>
> I'm sure it's the same in a bash script, even if the script doesn't
> explicitly provide a return value I imagine the shell returns something
> anyway, it's just that it's meaningless when that happens.

In a bash script, "exit" with no parameter and just falling off the end
of the script are both equivalent to "exit $?" and return the status
from the last command or shell construct executed in the script.

-- 
Bob Nichols "NOSPAM" is really part of my email address.
 Do NOT delete it.

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


[CentOS] Unable to mount Centos 5.6 Server via nfs4 - Operation Not Permitted - MADNESS!

2011-05-30 Thread RILINDO FOSTER
After getting a reasonably configured NFS4 setup working on my Scientific Linux 
server, I spent a majority of my evening trying to do the same with my Centos 5 
box, with fruitless results. Most attempts to mount that server returns the 
following message:

[root@sl01 log]# mount -t nfs4 192.168.15.200:/opt/company_data /mnt
mount.nfs4: Operation not permitted


As nearest as I can tell, I was able to setup the ports correctly in 
/etc/sysconfig/nfs

[root@centos sysconfig]# grep -v \# nfs
RQUOTAD_PORT=875
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
STATD_PORT=662


As well as my /etc/services file:

# Local services
rquotad 875/tcp
lockd32803/tcp
lockd32769/tcp
mountd 892/tcp
statd 662/tcp
rquotad 875/udp
lockd   32803/udp
lockd   32769/udp
mountd 892/udp
statd  662/udp
[root@centos sy

rpcinfo -p seems fine (although I understand that is not relevent with nfs4)

[root@centos sysconfig]# rpcinfo -p
   program vers proto   port
102   tcp111  portmapper
102   udp111  portmapper
1000241   udp662  status
1000241   tcp662  status
1000111   udp875  rquotad
1000112   udp875  rquotad
1000111   tcp875  rquotad
1000112   tcp875  rquotad
132   udp   2049  nfs
133   udp   2049  nfs
134   udp   2049  nfs
1000211   udp  32769  nlockmgr
1000213   udp  32769  nlockmgr
1000214   udp  32769  nlockmgr
1000211   tcp  32803  nlockmgr
1000213   tcp  32803  nlockmgr
1000214   tcp  32803  nlockmgr
132   tcp   2049  nfs
133   tcp   2049  nfs
134   tcp   2049  nfs
151   udp892  mountd
151   tcp892  mountd
152   udp892  mountd
152   tcp892  mountd
153   udp892  mountd
153   tcp892  mountd

And services are running:

[root@centos sysconfig]# service nfs status
rpc.mountd (pid 6321) is running...
nfsd (pid 6318 6317 6316 6315 6314 6313 6312 6311) is running...
rpc.rquotad (pid 6306) is running...
[root@centos sysconfig]# service nfslock  status
rpc.statd (pid  6248) is running...
[root@centos sysconfig]# service portmap  status
portmap (pid 6210) is running...

And firewall is open both ways:

[root@centos sysconfig]# iptables -n -L | grep -E 
'(2049|111|32759|32803|662|875|892)'
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:111 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:2049 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:2049 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:875 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:875 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:875 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:892 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:662 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:32803 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:32803 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:662 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:892 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:111 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:111 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:111 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:2049 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:2049 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:32803 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:32803 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:662 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:662 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:892 
ACCEPT tcp  --  0.0.0.0/00.0.0.0/0   tcp dpt:875 
ACCEPT udp  --  0.0.0.0/00.0.0.0/0   udp dpt:875 


I am about to mount via NFS3, so that part I know works. 

Is there a known problem with NFS4 on Centos (or Red Hat) 5? Or am I missing 
something someplace?

 - Rilindo



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


Re: [CentOS] Unable to mount Centos 5.6 Server via nfs4 - Operation Not Permitted - MADNESS!

2011-05-30 Thread Tom H
On Mon, May 30, 2011 at 9:31 PM, RILINDO FOSTER  wrote:
>
> After getting a reasonably configured NFS4 setup working on my Scientific 
> Linux
> server, I spent a majority of my evening trying to do the same with my Centos 
> 5
> box, with fruitless results. Most attempts to mount that server returns the 
> following
> message:
>
> [root@sl01 log]# mount -t nfs4 192.168.15.200:/opt/company_data /mnt
> mount.nfs4: Operation not permitted
>
> As nearest as I can tell, I was able to setup the ports correctly in 
> /etc/sysconfig/nfs
>
> [root@centos sysconfig]# grep -v \# nfs
> RQUOTAD_PORT=875
> LOCKD_TCPPORT=32803
> LOCKD_UDPPORT=32769
> MOUNTD_PORT=892
> STATD_PORT=662
>
> [root@centos sysconfig]# rpcinfo -p
>   program vers proto   port
>    10    2   tcp    111  portmapper
>    10    2   udp    111  portmapper
>    100024    1   udp    662  status
>    100024    1   tcp    662  status
>    100011    1   udp    875  rquotad
>    100011    2   udp    875  rquotad
>    100011    1   tcp    875  rquotad
>    100011    2   tcp    875  rquotad
>    13    2   udp   2049  nfs
>    13    3   udp   2049  nfs
>    13    4   udp   2049  nfs
>    100021    1   udp  32769  nlockmgr
>    100021    3   udp  32769  nlockmgr
>    100021    4   udp  32769  nlockmgr
>    100021    1   tcp  32803  nlockmgr
>    100021    3   tcp  32803  nlockmgr
>    100021    4   tcp  32803  nlockmgr
>    13    2   tcp   2049  nfs
>    13    3   tcp   2049  nfs
>    13    4   tcp   2049  nfs
>    15    1   udp    892  mountd
>    15    1   tcp    892  mountd
>    15    2   udp    892  mountd
>    15    2   tcp    892  mountd
>    15    3   udp    892  mountd
>    15    3   tcp    892  mountd
>
> And services are running:
>
> [root@centos sysconfig]# service nfs status
> rpc.mountd (pid 6321) is running...
> nfsd (pid 6318 6317 6316 6315 6314 6313 6312 6311) is running...
> rpc.rquotad (pid 6306) is running...
> [root@centos sysconfig]# service nfslock  status
> rpc.statd (pid  6248) is running...
> [root@centos sysconfig]# service portmap  status
> portmap (pid 6210) is running...
>
> And firewall is open both ways:
>
> [root@centos sysconfig]# iptables -n -L | grep -E 
> '(2049|111|32759|32803|662|875|892)'
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:111
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:2049
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:2049
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:875
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:875
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:875
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:892
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:662
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:32803
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:32803
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:662
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:892
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:111
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:111
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:111
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:2049
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:2049
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:32803
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:32803
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:662
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:662
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:892
> ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:875
> ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:875
>
> I am about to mount via NFS3, so that part I know works.
>
> Is there a known problem with NFS4 on Centos (or Red Hat) 5? Or am I missing 
> something someplace?

Are the values of "Domain" in "/etc/idmapd.conf" the same on the
client and the server?

FYI: For nfsv4, there's no need to have any ports other than 111 and 2049.

(Are you using "fsid=0" as an option?)
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Unable to mount Centos 5.6 Server via nfs4 - Operation Not Permitted - MADNESS!

2011-05-30 Thread RILINDO FOSTER
I can try to play around with the idmapd.conf and set the fsid=0 option. What 
bugs me, though, is that neither option is enabled on the SL6/RHES6 server and 
I am able to mount via nfs4:

[root@centos sysconfig]# nfsstat
Server rpc stats:
calls  badcalls   badauthbadclntxdrcall
1540  0  0  0   

Server nfs v3:
null getattr  setattr  lookup   access   readlink 
28   36% 27   35% 0 0% 0 0% 0 0% 0 0% 
read writecreate   mkdirsymlink  mknod
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 
remove   rmdirrename   link readdir  readdirplus  
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 
fsstat   fsinfo   pathconf commit   
3 3% 16   20% 3 3% 0 0% 

Server nfs v4:
null compound 
32   45% 38   54% 

Server nfs v4 operations:
op0-unused   op1-unused   op2-future   access   closecommit   
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 
create   delegpurge   delegreturn  getattr  getfhlink 
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 
lock locktlockulookup   lookup_root  nverify  
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 
open openattr open_confopen_dgrdputfhputpubfh 
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 
putrootfhread readdir  readlink remove   rename   
35   92% 0 0% 0 0% 0 0% 0 0% 0 0% 
renewrestorefhsavefh   secinfo  setattr  setcltid 
1 2% 0 0% 0 0% 0 0% 0 0% 1 2% 
setcltidconf verify   writerellockowner 
1 2% 0 0% 0 0% 0 0% 

Client rpc stats:
calls  retransauthrefrsh
38 0  0   

Client nfs v4:
null read writecommit   open open_conf
0 0% 0 0% 0 0% 0 0% 1 2% 1 2% 
open_noatopen_dgrdclosesetattr  fsinfo   renew
0 0% 0 0% 1 2% 1 2% 411% 0 0% 
setclntidconfirm  lock locktlockuaccess   
1 2% 1 2% 0 0% 0 0% 0 0% 2 5% 
getattr  lookup   lookup_root  remove   rename   link 
719% 513% 2 5% 0 0% 0 0% 0 0% 
symlink  create   pathconf statfs   readlink readdir  
0 0% 0 0% 0 0% 2 5% 0 0% 2 5% 
server_caps  delegreturn  
616% 0   



root@centos sysconfig]# cat /etc/mtab 
/dev/sda6 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sda8 /home ext3 rw 0 0
/dev/sda5 /usr ext3 rw 0 0
/dev/sda3 /opt ext3 rw 0 0
/dev/sda2 /var ext3 rw 0 0
/dev/sda1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0
/opt/company_data /exports/company_data none rw,bind 0 0
192.168.15.100:/opt/company_data /mnt nfs4 rw,addr=192.168.15.100 0 0

(Of course, it could be that SL6 did things a little differently with their 
distro's implementation of NFS4, but I doubt it).


On May 30, 2011, at 10:29 PM, Tom H wrote:

> On Mon, May 30, 2011 at 9:31 PM, RILINDO FOSTER  wrote:
>> 
>> After getting a reasonably configured NFS4 setup working on my Scientific 
>> Linux
>> server, I spent a majority of my evening trying to do the same with my 
>> Centos 5
>> box, with fruitless results. Most attempts to mount that server returns the 
>> following
>> message:
>> 
>> [root@sl01 log]# mount -t nfs4 192.168.15.200:/opt/company_data /mnt
>> mount.nfs4: Operation not permitted
>> 
>> As nearest as I can tell, I was able to setup the ports correctly in 
>> /etc/sysconfig/nfs
>> 
>> [root@centos sysconfig]# grep -v \# nfs
>> RQUOTAD_PORT=875
>> LOCKD_TCPPORT=32803
>> LOCKD_UDPPORT=32769
>> MOUNTD_PORT=892
>> STATD_PORT=662
>> 
>> [root@centos sysconfig]# rpcinfo -p
>>   program vers proto   port
>>102   tcp111  portmapper
>>102   udp111  portmapper
>>1000241   udp662  status
>>1000241   tcp662  status
>>1000111   udp875  rquotad
>>1000112   udp875  rquotad
>>1000111   tcp875  rquotad
>>1000112   tcp875  rquotad
>>132   udp   2049  nfs
>>133   udp   2049  nfs
>>134   udp   2049  nfs
>>100