QFS error on centOS7

78 views
Skip to first unread message

yangxia...@sina.com

unread,
Apr 25, 2016, 12:14:45 AM4/25/16
to QFS Development
I am compiling QFS for Centos 7, it has an error when i run
./example_setup.py -a install , it says in the file MetaServer.out like these:

ERROR - UserAndGroup.c:496 getgrent error: no such file or directory 2
FATAL - metaserver_main.c:560 fail to set parameters

I know it workes well for Centos 6,why can not work for Centos 7?

yangxia...@sina.com

unread,
Apr 25, 2016, 12:16:24 AM4/25/16
to QFS Development, yangxia...@sina.com
在 2016年4月25日星期一 UTC+8下午12:14:45,yangxia...@sina.com写道:

Faraaz Sareshwala

unread,
Apr 25, 2016, 1:34:00 AM4/25/16
to qfs-...@googlegroups.com, yangxia...@sina.com
Hi there,

Is this while you are running qfstest.sh or during compilation?


Faraaz
>--
>You received this message because you are subscribed to the Google Groups "QFS Development" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>To post to this group, send email to qfs-...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

yangxia...@sina.com

unread,
Apr 25, 2016, 1:56:38 AM4/25/16
to QFS Development, yangxia...@sina.com
It was the first time that I run
./example_setup.py -a install
that occurs the error,it seem that in the pthon script when it call
~/bin/metaserver -c qfsbase/meta/conf/MetaServer.prp > qfsbase/meta/MetaSever.out 2>&1
that makes the error,I am very sure that it is not because I run qfstest.sh script or during compilation.

在 2016年4月25日星期一 UTC+8下午1:34:00,Faraaz Sareshwala写道:

yangxia...@sina.com

unread,
Apr 25, 2016, 2:20:49 AM4/25/16
to QFS Development, yangxia...@sina.com
在 2016年4月25日星期一 UTC+8下午1:34:00,Faraaz Sareshwala写道:
It was the first time that I run
./example_setup.py -a install
that occurs the error,it seems that in the pthon script when it call
~/bin/metaserver -c qfsbase/meta/conf/MetaServer.prp > qfsbase/meta/MetaSever.out 2>&1
that makes the error,I am very sure that it is not because I am running the qfstest.sh script or during compilation.

Faraaz Sareshwala

unread,
Apr 25, 2016, 8:43:15 PM4/25/16
to qfs-...@googlegroups.com, yangxia...@sina.com
Right, I took a look into this further.

It looks like the sample_setup.py script depends on the pidof command which isn’t installed by default on centos 7. You can install it by running yum install -y sysvinit-tools. It should work after that.

Hope that helps!

Note that we are planning on overhauling that entire sample_setup.py interface entirely. It’s really brittle right now and we have plans to put something a lot more robust into place.

Faraaz
>To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/675ca2a9-556e-4ddf-a665-7a0774bff8e5%40googlegroups.com.

yangxia...@sina.com

unread,
Apr 26, 2016, 12:13:29 AM4/26/16
to qfs-...@googlegroups.com, yangxia...@sina.com
Thank you for your help, But I have allready installed the tool, and it still can not work,I have debug the code in the file ./src/cc/meta/UserAndGroup.cc,it seems 
that the code below can not work when I call getgrent the last time: 

const struct group* const theEntryPtr = getgrent(); 
if (! theEntryPtr) { 
    theError = errno; 
    if (theError != 0) { 
    KFS_LOG_STREAM_ERROR << 
        "getgrent error: " << QCUtils::SysError(theError) << 
        KFS_LOG_EOM; 
    } 
break; 



在 2016年4月26日星期二 UTC+8上午8:43:15,Faraaz Sareshwala写道:
> Right, I took a look into this further.
>
> It looks like the sample_setup.py script depends on the pidof command which isn’t installed by default on centos 7. You can install it by running yum install -y sysvinit-tools. It should work after that.
>
> Hope that helps!
>
> Note that we are planning on overhauling that entire sample_setup.py interface entirely. It’s really brittle right now and we have plans to put something a lot more robust into place.
>
> Faraaz
>
>
>
> On 4/24/16, 10:56 PM, "qfs-...@googlegroups.com on behalf of yangxia...@sina.com" <qfs-...@googlegroups.com on behalf of yangxia...@sina.com> wrote:
>
> >It was the first time that I run
> >./example_setup.py -a install
> >that occurs the error,it seem that in the pthon script when it call
> >~/bin/metaserver -c qfsbase/meta/conf/MetaServer.prp > qfsbase/meta/MetaSever.out 2>&1
> >that makes the error,I am very sure that it is not because I run qfstest.sh script or during compilation.
> >
> >在 2016年4月25日星期一 UTC+8下午1:34:00,Faraaz Sareshwala写道:
> >> Hi there,
> >>
> >> Is this while you are running qfstest.sh or during compilation?
> >>
> >>
> >> Faraaz
> >>
> >> On 4/24/16, 9:16 PM, "qfs-...@googlegroups.com on behalf of yangxia...@sina.com" <qfs-...@googlegroups.com on behalf of yangxia...@sina.com> wrote:
> >>
> >> >在 2016年4月25日星期一 UTC+8下午12:14:45,yangxia...@sina.com写道:
> >> >> I am compiling QFS for Centos 7, it has an error when i run
> >> >> ./example_setup.py -a install , it says in the file MetaServer.out like these:
> >> >>
> >> >> ERROR - UserAndGroup.c:496 getgrent error: no such file or directory 2
> >> >> FATAL - metaserver_main.c:560 fail to set parameters
> >> >>
> >> >> I know it workes well for Centos 6,why can not work for Centos 7?
> >> >
> >> >--
> >> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
> >> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+unsubscribe@googlegroups.com.
> >> >To post to this group, send email to qfs-...@googlegroups.com.
> >> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
> >> >For more options, visit https://groups.google.com/d/optout.
> >
> >--
> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+unsubscribe@googlegroups.com.
Message has been deleted
Message has been deleted
Message has been deleted

Faraaz Sareshwala

unread,
Apr 26, 2016, 2:41:50 PM4/26/16
to qfs-...@googlegroups.com, yangxia...@sina.com
This function looks at /etc/group — I’m not super familiar with centos systems but I know that they have an /etc/group file. Just as a sanity check, can you ensure that the file exists and is readable?

Also, can you tell me which version of qfs are you trying to compile? Is it the master branch?
>> >> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >> >To post to this group, send email to qfs-...@googlegroups.com.
>> >> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
>> >> >For more options, visit https://groups.google.com/d/optout.
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >To post to this group, send email to qfs-...@googlegroups.com.
>> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/675ca2a9-556e-4ddf-a665-7a0774bff8e5%40googlegroups.com.
>> >For more options, visit https://groups.google.com/d/optout.
>
>> >> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >> >To post to this group, send email to qfs-...@googlegroups.com.
>> >> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
>> >> >For more options, visit https://groups.google.com/d/optout.
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >To post to this group, send email to qfs-...@googlegroups.com.
>> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/675ca2a9-556e-4ddf-a665-7a0774bff8e5%40googlegroups.com.
>> >For more options, visit https://groups.google.com/d/optout.
>
>
>
>> >> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >> >To post to this group, send email to qfs-...@googlegroups.com.
>> >> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
>> >> >For more options, visit https://groups.google.com/d/optout.
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >To post to this group, send email to qfs-...@googlegroups.com.
>> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/675ca2a9-556e-4ddf-a665-7a0774bff8e5%40googlegroups.com.
>> >For more options, visit https://groups.google.com/d/optout.
>
>
>
>> >> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >> >To post to this group, send email to qfs-...@googlegroups.com.
>> >> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
>> >> >For more options, visit https://groups.google.com/d/optout.
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >To post to this group, send email to qfs-...@googlegroups.com.
>> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/675ca2a9-556e-4ddf-a665-7a0774bff8e5%40googlegroups.com.
>> >For more options, visit https://groups.google.com/d/optout.
>
>
>
>> >> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >> >To post to this group, send email to qfs-...@googlegroups.com.
>> >> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
>> >> >For more options, visit https://groups.google.com/d/optout.
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >To post to this group, send email to qfs-...@googlegroups.com.
>> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/675ca2a9-556e-4ddf-a665-7a0774bff8e5%40googlegroups.com.
>> >For more options, visit https://groups.google.com/d/optout.
>
>
>
>> >> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >> >To post to this group, send email to qfs-...@googlegroups.com.
>> >> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/b541a1b9-785b-4ff9-bf6f-a252c558df9f%40googlegroups.com.
>> >> >For more options, visit https://groups.google.com/d/optout.
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups "QFS Development" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>> >To post to this group, send email to qfs-...@googlegroups.com.
>> >To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/675ca2a9-556e-4ddf-a665-7a0774bff8e5%40googlegroups.com.
>> >For more options, visit https://groups.google.com/d/optout.
>
>Thank you for your help, But I have allready installed the tool, and it still can not work,I have debug the code in the file ./src/cc/meta/UserAndGroup.cc,it seems
>that the code below can not work when I call getgrent the last time:
>
>const struct group* const theEntryPtr = getgrent();
>if (! theEntryPtr) {
> theError = errno;
> if (theError != 0) {
> KFS_LOG_STREAM_ERROR <<
> "getgrent error: " << QCUtils::SysError(theError) <<
> KFS_LOG_EOM;
> }
>break;
>}
>
>--
>You received this message because you are subscribed to the Google Groups "QFS Development" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to qfs-devel+...@googlegroups.com.
>To post to this group, send email to qfs-...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/qfs-devel/4671d75a-4de9-4d11-8157-efacc4b84b56%40googlegroups.com.

杨效振

unread,
Apr 26, 2016, 10:08:27 PM4/26/16
to QFS Development, yangxia...@sina.com
I am very sure that the /etc/group file exists and readable,  I have also made a test program to read this file.and it works wery well too.

I got the QFS from github by using the command :
 Is it not the master branch?

在 2016年4月27日星期三 UTC+8上午2:41:50,Faraaz Sareshwala写道:

杨效振

unread,
Apr 26, 2016, 11:13:24 PM4/26/16
to QFS Development, yangxia...@sina.com
I know why it can not work for CentOS7 now ! ! !

I have made a simple program just as the UserAndGroup.cc.But it works differently on CentOS6 and CentOS7.
The difference is that when I read the last line of the /etc/group  On CentOS7. it returns an error!!!
getgrent error: No such file or directory

It may be the bug of the system call getgrent.

But how can we fix the code that makes QFS works properly on different platform???


#include<grp.h>
#include<iostream>
#include<errno.h>
#include<string.h>
#include<stdint.h>
using namespace std;
int main()
{
int theError;
setgrent();
for (; ;) {
   errno = 0;
   const struct group* const theEntryPtr = getgrent();
   if (! theEntryPtr) {
       theError = errno;
       if (theError != 0) {
           cout <<
               "getgrent error: " << strerror(theError) <<
           endl;
       }
       break;
   }
   cout << theEntryPtr->gr_name << " : "  << theEntryPtr->gr_gid << endl;
   const string   theName = theEntryPtr->gr_name;
   uint32_t const theGid  = (uint32_t)theEntryPtr->gr_gid;
}
endgrent();
}


在 2016年4月27日星期三 UTC+8上午2:41:50,Faraaz Sareshwala写道:
This function looks at /etc/group — I’m not super familiar with centos systems but I know that they have an /etc/group file. Just as a sanity check, can you ensure that the file exists and is readable?

Michael Ovsiannikov

unread,
Apr 26, 2016, 11:38:03 PM4/26/16
to <qfs-devel@googlegroups.com>, yangxia...@sina.com

I’d suggest first to see if red hat / sent os has any updates / fixes for this. Otherwise a kluge to ignore errno completely or in if more than one entry was returned already would work.

Below is relevant section of mac os and linux man pages. The linux one (the second) is a bit more vague, though this sounds like cent os bug.

— Mike.

RETURN VALUES
     The functions getgrent(), getgrnam(), and getgrgid(), return a pointer to a group structure on success or NULL if
     the entry is not found or if an error occurs.  If an error does occur, errno will be set.  Note that programs must
     explicitly set errno to zero before calling any of these functions if they need to distinguish between a non-exis-
     tent entry and an error.  The functions getgrnam_r(), getgrgid_r(), and getgruuid_r() return 0 if no error
     occurred, or an error number to indicate failure.  It is not an error if a matching entry is not found.  (Thus, if
     result is set to NULL and the return value is 0, no matching entry exists.)


       The getgrent() function returns a pointer to a group structure, or
       NULL if there are no more entries or an error occurs.

       Upon error,  errno may be set.  If one wants to check errno after the
       call, it should be set to zero before the call.


Reply all
Reply to author
Forward
0 new messages