Nsswitch behavior -vs- man page?

I have a question about Solaris 10's /etc/nsswitch.conf
functionality. It seems like it does not work as it use to, say in
Solaris 8 or 9, yet the man page for nsswitch.conf indicates that for
DNS, NIS, and "all other sources" that the DEFAULT criteria should be
"NOTFOUND=continue".
Yet for the past few years it seems I must manually put something like
the lines below in the nsswitch file for "continue" to work
correctly? Is this a bug, or am I completely misunderstanding the man
page and/or how nsswitch REALLY works? Very possible!
hosts: files [NOTFOUND=continue] dns [NOTFOUND=continue] nis
ipnodes: files [NOTFOUND=continue] dns [NOTFOUND=continue] nis
If I use the "default sample file for NIS (/etc/nsswitch.nis) which
may contain something like "hosts: nis [NOTFOUND=return] files" and
yet I want to add DNS, what might the line look like?
I know I have to copy the sample file to the .conf file extension.
Thanks,

Your question is a little fuzzy, but I'll try to answer anyway...
nsswitch.conf file is responsible for specifying the name services that are to be used when trying to find a particular piece of information.
In Solaris, there are 5 possible sources (name services): files, nis, nisplus, dns and ldap.
You may specify multiple (even all) sources to be used. All sources are checked in the order they are written on a line.
Every source may return 4 status values: SUCCESS, NOTFOUND, UNAVAIL or TRYAGAIN.
For every return status, there are 2 possible actions: continue and return. continue means "try the next source", return means "don't look any further". The default action for every status is continue, except for the SUCCESS status, when action is *return", obviously...
One can overwrite the default action for each status, by specifying what action should be taken for any return status.
Let's take for instance this line:
hosts: files dns [NOTFOUND=continue] nis [NOTFOUND=return] ldapThis is interpreted as follows:
- first check "files" (i.e. check /etc/inet/inpnodes, /etc/inet/hosts); no action is specified for any return status, so default actions are in place: if the entry is found on files (SUCCESS), then action is return" , if status is anything else, then action is continue* and next source is checked
- next source is "dns"; if SUCCESS, program will return; if NOTFOUND , then continue to the next source (this is also the default action, but it doesn't matter - this line is just for teaching purposes...); if UNAVAIL (service dns is not configured) or TRYAGAIN (server was too busy to respond to request), then apply default action: *continue"
- next source is nis; if SUCCESS ,then default action (*return*); if NOTFOUND then overwrite default action and return ; so, if the entry is found or not found in nis, the next source (ldap) will not be checked.
and so on....
>
If I use the "default sample file for NIS (/etc/nsswitch.nis) which
may contain something like "hosts: nis [NOTFOUND=return] files" and
yet I want to add DNS, what might the line look like?
{quote}
Well, it depends; suppose you want to check dns after nis and before files. The line may look like this:
{code}
hosts: nis dns files
{code}
The above entry will check dns even if nis returns NOTFOUND.
Hope you got the idea...
kido

Similar Messages

  • No scrolling when viewing man pages with Gnome terminal?

    Hi all,
    I have just installed Oracle Solaris 11 on x86. For a long time I've used Solaris 9 on SPARC. I like the new OS, but I'm having a problem viewing man pages with Gnome terminal. When I view a long man page, e.g., "man newfs", I don't get a functional scroll bar on the right hand side of the window. And although the space bar works to advance the page, when I reach the end, it doesn't return to the command prompt. It just beeps, prints "END", and I can only exit by closing the window. Can anyone tell me how to fix this? Suggestions would be much appreciated.
    Many thanks,
    Chris Tidy

    It does sound like you're using "less" instead of more. When you see the "(END)" prompt you can simply type "q" and it will exit back to the command line prompt making it unnecessary to close the window. See the "less" manual page for more detail on the less command. Under Solaris 9 the paging was done with the "more" command. If you set the PAGER environment variiable to "more" the man page will use more and revert to the behavior you'd be used to with Solaris 9. Less erases the text you've already read when you type that final "q" which is a behavior I don't like. I didn't bother to determine if there is a way to fix that with less, I just went back to more. The choice between "more" and "less" is a personal preference.

  • Thr_create() returns -1 which isn't specified in the man page. What is -1?

    Hello,
    I'm for the first time experimenting with Solaris threads as I'm porting an AIX app. over to Solaris.
    Anyhow, I have a sample program that creates a simple thread. For some reason, the return value of of the initial thr_create is -1, which isn't specified in the man page for thr_create. The man page lists the following return values, non of which are -1:
    RETURN VALUES
    Zero indicates a successful return and a non-zero value
    indicates an error.
    ERRORS
    If any of the following conditions occur, these functions
    fail and return the corresponding value:
    EAGAIN The system-imposed limit on the total number
    of threads in a process has been exceeded or
    some system resource has been exceeded (for
    example, too many LWPs were created).
    EINVAL The value specified by attr is invalid.
    If any of the following conditions are detected,
    pthread_create() fails and returns the corresponding value:
    ENOMEM Not enough memory was available to create the
    new thread.
    If any of the following conditions are detected,
    thr_create() fails and returns the corresponding value:
    EINVAL o stack_base is not NULL and stack_size is
    less than the value returned by
    thr_min_stack(3T).
    o stack_base is NULL and stack_size is not
    zero and is less than the value returned by
    thr_min_stack(3T).
    However, I don't see a -1 there and therefore, don't know what this means.
    Here is the simple code that I wrote for this experiment as well as the output. It doesn't get too far into the program before exiting - I've bolded where it exits:
    #define _REENTRANT
    #include <stdio.h>
    #include <thread.h>
    #include <errno.h>
    /* Function prototypes for thread routines */
    void sub_a(void );
    void sub_b(void );
    void sub_c(void );
    void sub_d(void );
    void sub_e(void );
    void sub_f(void );
    thread_t thr_a, thr_b, thr_c;
    void main()
    thread_t main_thr;
    int rc = 0;
    main_thr = thr_self();
    printf("Main thread = %d\n", main_thr);
    if (rc = thr_create(NULL, 0, sub_b, NULL, THR_NEW_LWP, &thr_b))
    printf("\n rc = %d",rc);
    switch(rc)
    case EAGAIN: printf("This one1");
    break;
    case EINVAL: printf("This one2");
    break;
    case ENOMEM: printf("This one3");
    break;
    default: printf("rc = %d");
    break;
    fprintf(stderr,"Can't create thr_b\n"),
    * exit(1); *
    /* if (thr_create(NULL, 0, sub_a, (void *)thr_b, THR_NEW_LWP, &thr_a))
    fprintf(stderr,"Can't create thr_a\n"), exit(1); */
    if (thr_create(NULL, 0, sub_c, (void *)main_thr, THR_NEW_LWP, &thr_c))
    fprintf(stderr,"Can't create thr_c\n"), exit(1);
    printf("Main Created threads A:%d B:%d C:%d\n", thr_a, thr_b, thr_c);
    printf("Main Thread exiting...\n");
    thr_exit((void *)main_thr);
    void sub_a(void arg)
    thread_t thr_b = (thread_t) arg;
    thread_t thr_d;
    int i;
    printf("A: In thread A...\n");
    if (thr_create(NULL, 0, sub_d, (void *)thr_b, THR_NEW_LWP, &thr_d))
    fprintf(stderr, "Can't create thr_d\n"), exit(1);
    printf("A: Created thread D:%d\n", thr_d);
    /* process
    for (i=0;i<1000000*(int)thr_self();i++);
    printf("A: Thread exiting...\n");
    thr_exit((void *)77);
    void * sub_b(void *arg)
    int i;
    printf("B: In thread B...\n");
    /* process
    for (i=0;i<1000000*(int)thr_self();i++);
    printf("B: Thread exiting...\n");
    thr_exit((void *)66);
    void * sub_c(void *arg)
    void *status;
    int i;
    thread_t main_thr, ret_thr;
    main_thr = (thread_t)arg;
    printf("C: In thread C...\n");
    if (thr_create(NULL, 0, sub_f, (void *)0, THR_BOUND|THR_DAEMON, NULL))
    fprintf(stderr, "Can't create thr_f\n"), exit(1);
    printf("C: Join main thread\n");
    if (thr_join(main_thr,(thread_t *)&ret_thr, &status))
    fprintf(stderr, "thr_join Error\n"), exit(1);
    printf("C: Main thread (%d) returned thread (%d) w/status %d\n", main_thr, ret_thr, (int) status);
    /* process
    for (i=0;i<1000000*(int)thr_self();i++);
    printf("C: Thread exiting...\n");
    thr_exit((void *)88);
    void * sub_d(void *arg)
    thread_t thr_b = (thread_t) arg;
    int i;
    thread_t thr_e, ret_thr;
    void *status;
    printf("D: In thread D...\n");
    if (thr_create(NULL, 0, sub_e, NULL, THR_NEW_LWP, &thr_e))
    fprintf(stderr,"Can't create thr_e\n"), exit(1);
    printf("D: Created thread E:%d\n", thr_e);
    printf("D: Continue B thread = %d\n", thr_b);
    thr_continue(thr_b);
    printf("D: Join E thread\n");
    if(thr_join(thr_e,(thread_t *)&ret_thr, &status))
    fprintf(stderr,"thr_join Error\n"), exit(1);
    printf("D: E thread (%d) returned thread (%d) w/status %d\n", thr_e,
    ret_thr, (int) status);
    /* process
    for (i=0;i<1000000*(int)thr_self();i++);
    printf("D: Thread exiting...\n");
    thr_exit((void *)55);
    void * sub_e(void *arg)
    int i;
    thread_t ret_thr;
    void *status;
    printf("E: In thread E...\n");
    printf("E: Join A thread\n");
    if(thr_join(thr_a,(thread_t *)&ret_thr, &status))
    fprintf(stderr,"thr_join Error\n"), exit(1);
    printf("E: A thread (%d) returned thread (%d) w/status %d\n", ret_thr, ret_thr, (int) status);
    printf("E: Join B thread\n");
    if(thr_join(thr_b,(thread_t *)&ret_thr, &status))
    fprintf(stderr,"thr_join Error\n"), exit(1);
    printf("E: B thread (%d) returned thread (%d) w/status %d\n", thr_b, ret_thr, (int) status);
    printf("E: Join C thread\n");
    if(thr_join(thr_c,(thread_t *)&ret_thr, &status))
    fprintf(stderr,"thr_join Error\n"), exit(1);
    printf("E: C thread (%d) returned thread (%d) w/status %d\n", thr_c, ret_thr, (int) status);
    for (i=0;i<1000000*(int)thr_self();i++);
    printf("E: Thread exiting...\n");
    thr_exit((void *)44);
    void sub_f(void arg)
    int i;
    printf("F: In thread F...\n");
    while (1) {
    for (i=0;i<10000000;i++);
    printf("F: Thread F is still running...\n");
    OUTPUT:
    # /emc/smithr15/solthread
    Main thread = 1
    rc = -1Can't create thr_b
    rc = -1#
    Any ideas as to what -1 indicates and how to solve this?
    Thanks for your response,
    dedham_ma_man

    ok, my bad. I wasn't linking in the -lthread library.
    Thanks anyway.

  • Can we update the man pages for "dynamic_pager"?

    The configuration file is listed as, /Library/Preferences/com.apple.virtualMemory.plist but from what I understand, it is located in /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist.

    Send Apple feedback about it, and they will likely update the man page: http://www.apple.com/feedback/macosx.html
    Alternatively you can edit the man page file for the dynamic_pager itself. It is located here: /usr/share/man/man8/dynamic_pager.8

  • Bug with Solaris man page on dlsym

    I hope someone at Sun working on Solaris is reading this. There are bugs in the Solaris 10 man page on dlsym - there are a couple of places that says "see the .". Apparently soemthing is missing. My version of man pages is "Last change: 26 Sep 2005".

    The prototype of pthread_create() is correct on Solaris 10 man page (SunOS 5.10 Last change: 23 Mar 2005):
    int pthread_create(pthread_t *restrict   thread,   const
    pthread_attr_t *restrict         attr,         void
    *(*start_routine)(void*), void *restrict arg);
    But the prototype of pthread_cleanup_push() is correct on Solaris 10 man page (SunOS 5.10 Last change: 4 Oct 2005) is incorrect:
    void pthread_cleanup_push(void (*handler, void *),void *arg);
    I guess Sun simply has to check all the man pages of the pthread functions carefully one by one to make sure this error is fixed.

  • Man pages in other languages

    Hi,
    Is it possible to install man pages in other languages (i.e. Spanish)? Bash shell seems to be working in Spanish but not man pages. I have checked and it only comes with some languages (Russian, German, etc.) Could it be possible to install them from any source?
    Thanks in advance

    Open Dictionary.app in the Applications folder and go to its Preferences.  There you will see what Apple provides and you can check the boxes to activate it.  If you want something more, you will have to find it on the internet and install it.
    http://m10lmac.blogspot.com/2013/01/adding-dictionaries-to-dictionaryapp.html

  • How to install package's man page

    Hi all!
    I'm the maintainer of pcsx2-svn in AUR and currently the installation process doesn't install the man page automatically. In the source code I have a "pcsx2.man" file, that I'm gzipping and moving to the correct man folder. See command:
    gzip -9 "${pkgdir}/opt/pcsx2/docs/pcsx2.man"
    mv "${pkgdir}/opt/pcsx2/docs/pcsx2.man.gz" "${pkgdir}/usr/share/man/man1/pcsx2.1.gz"
    Is there a more proper way to do this in Archlinux?
    Thanks in advance!
    p.s.: `make install` will not install the man page, only the translation files.

    Ah, simple as that? I didn't how this works until now... Thanks, falconindy!
    Last edited by josephg (2011-03-21 03:01:59)

  • Makepkg: How to include source-bundled 'man pages' in the package?

    I'm trying to create a PKGBUILD for my own Python program.
    The source code has been packaged using Python's distutils.  Now, AFAICT distutils do not help you in any intelligent way to include a man page, so I just used a MANIFEST template to add the file to the source package.
    As for the PKGBUILD, I'm currently using an 'install -D -m0644' command (in the 'package' function) to copy the page from a directory under $srcdir to "${pkgdir}/usr/share/man/man1/${pkgname}.1.gz".
    However, seeing that makepkg has some built-in functions for compressing man pages, I figured that maybe it could deal with the proper placement too? My manual approach works nicely, but well, I figure the less of a hack job, the better.
    Thanks in advance - this is my first program and package build so I wanna get it right :)

    Thanks joyfulgirl - I guess I hadn't really thought through what kind of a deal makepkg is.
    At any rate, I figured I wouldn't have been the only Pythonista dealing with this issue and starting reading other people's setup scripts and according to Mutagen's setup.py putting desktop software man pages in 'share/man/man1' under the 'installation prefix' (a local variable, usually '/usr' or '/usr/local') can be considered a POSIX universal. Don''t know if this is reliable or just one hack replacing another, but it would mean being able to let Python's setup script take care of pretty much everything.

  • Can't view man pages on solaris 8 x86

    Hi,
    I installed solaris 8 on a intel x86 machine not using the webwizard because I wanted a minimal installation.
    When I try to view man pages I get the following error:
    man manReformatting page. Please Wait...Invalid SGML. File cannot be formatted
    sys(cd /usr/share/man; /usr/lib/sgml/sgml2roff /usr/share/man/sman1/man.1 > /tmp/sman_3827) fail!
    aborted (sorry)
    when I list /usr/lib/sgml then I got the following files:
    ls -ltotal 2830
    -rwxr-xr-x 1 root bin 68016 Jan 9 2000 instant
    -rwxr-xr-x 1 root bin 1366552 Jan 9 2000 nsgmls
    -rwxr-xr-x 1 root bin 3183 Jan 6 2000 sgml2roff
    Don't know what is wrong but I think I'm missing a package, anybody clues...
    with regards,
    Martijn de Munnik
    [email protected]

    Depending on how minimal your install was, you may not have installed the man pages.
    Take a look in /usr/share/man and see if you have the man pages installed, and if not, install them.

  • Man pages present, utilities absent? ("at" "talk" others?) [Solved]

    Hi,
    I wasn't sure where to post this so I'm gonna post it here.
    I've got man page entries from certain utiilities from the posix programmers manual, like "at" and "talk" but these utilities aren't actually installed,
    I've searched the pacman repository and I'm not actually sure these utilities are even provided as a package at all.
    Is there something that I can use like "at"?  (besides crontabs)
    Also, is this worth filing a bug report over?  (I searched the bugs list, I didn't find anything matching this description, although I only tried searching for "man pages" and "posix", and only checked the first page for "man pages".
    There's also some problems with viewing certain man-pages, like that dhcpcd man page where some of the characters are garbled, but I think this is probably a known bug relating to the switchover to UTF-8 as the standard locale.
    Thanks
    Last edited by pseudonomous (2008-10-08 23:30:57)

    The pkg 'man-pages' is directly taken from http://www.kernel.org/doc/man-pages/, which is funded by the Linux Foundation. You can see in the link that this pkg provides man pages for system-calls, glibc lib functions, device-files, file-formats and section 7 (miscellanea).
    Each pkg (e.g. util-linux-ng) is supposed to provide it's own manual pages. The 'POSIX programmer manuals' are provided to document the fact that how should these utilities behave or be implemented (if somebody wants to implement them...). This doesn't mean that these utilities are installed (they may be if their pkg is installed).
    Hope it helps !!
    P.S. POSIX is a *nix standardization effort.
    Last edited by Onwards (2009-01-17 18:35:11)

  • Priocntl system call returning values not in man page

    If you look at the man page for priocntl(2) it says that pc_clname in pcinfo_t will only contain the following values:
    RT for realtime
    TS for time-share
    FX for fixed-priority
    but I've also seen the following returned
    FSS presumably for Fair share
    IA presumable for Interactive
    Is this just a doc bug or is priocntl not supposed to be passing these back. The way priocntl(1) and (2) read I was inferring that the difference was somewhat on purpose in that Interactive mode is just a special Time Share mode and thus would show up as TS when queried using priocntl(2).
    You may ask who cares but we use a third party class library (RW) and the version of the code we have, which I will admit is old, only handles TS and RT coming back from priocntl, exceptions when IA comes back.
    On a related note, does anyone know if a "workstation" machine will somehow default to Interactive mode for some processes, namely the ones not started at boot time? On a server box, e450, if you run 'priocntl -d -i all. All the processes show up under Time Share but if I run the same
    command on a workstation box, sparc 5, I get that some are in Time Share and others are in Interactive.
    Thanks.

    Or you can use one of these in the JSP page:
    <jsp:usebean id="var_name" class="class_name" scope="request">Only thing to remember is that if it can't find the variable name then it will call the default constructor to create a new instance, and if that doesn't exist then you will get a runtime error in your JSP page which looks pretty ugly.

  • Correct location of man pages?

    Hi, I'm still pretty new at the command line. I installed growlnotify to play around with it, but the install script puts the man page in the wrong place (/usr/local/man/man1). I found a post that said it should be moved to /usr/local/share/man/man1, but that directory doesn't exist.
    Where is the correct place to move it?
    And the command should look like this, right?:
    $ mv /usr/local/man/man1/growlnotify.1 CORRECT-DIRECTORY
    Thanks for any help.
    Message was edited by: aaronfalls

    Both locations are both correct. /usr/local is the traditional location for may software packages get installed. But platform A may like /usr/local/man and platform B may like /usr/local/share/man. The Growl developer may have started life on a platform that used /usr/local/man and used that because it what they always use.
    Just add the path to the MANPATH environment variable.
    NOTE: fink.com puts their man pages in /sw/man. MacPorts.org uses both /opt/local/man and /opt/local/share/man, most likely based on what the OpenSource author choose, and not something MacPorts choose.
    My current MANPATH contains the following man page locations:
    /sw/share/man
    /usr/share/man
    /usr/local/share/man
    /usr/X11/man
    /sw/lib/perl5/5.8.8/man
    /usr/X11R6/man
    /sw/lib/perl5-core/5.8.6/man
    /sw/lib/perl5/5.8.6/man
    /opt/local/man
    /usr/local/man
    /opt/local/share/man

  • Man pages don't work

    hi,
    i updated today and my man pages sort of don't work anymore.
    the j and k keys don't work anymore to scroll up and down.
    same thing happens when i use the less command on anything.
    what could that be?

    tomk wrote:What applications were updated?
    just pciutils this time

  • Hyperlinks in Terminal man pages

    Several third party applications (eg ManOpen) put hyperlinks in man pages. Often this is done on the fly using the same man page source as the Terminal.
    Does Apple do this with the Terminal or any other applications which use local (ie not web) man pages?
    My groff_mdoc man page says:
          .Lk To be written
    but a more informative description at http://www.daemon-systems.org/man/mdoc.7.html says:
          .Lk link (for conversion to HTML). Usage: .Lk <href> [anchor-text]
    I suspect Lk has not been widely used and that third party applications probably use the existing Xr tags about which my groff_mdoc man page says:
    Manual Page Cross References
          The '.Xr' macro expects the first argument to be a manual page name. The optional second argument, if a string (defining the manual section), is put into parentheses.
          Usage: .Xr ⟨man page name⟩ [⟨section⟩] ...
            .Xr mdoc        mdoc
            .Xr mdoc ,      mdoc,
            .Xr mdoc 7      mdoc(7)
            .Xr xinit 1x ;  xinit(1x);
          The default width is 10n.
    Is it possible to get the Terminal to use these existing Xr tags as hyperlinks?

    Sorry, I didn't peruse that link. On my machine, man:<commmand> works in Safari.
    Thanks for that I had misread the instructions and tried man: ls and man ls (as per terminal) rather than the correct man:ls
    That's incorrect. This example is from the chmod manpage:
    +     The -H, -L and -P options are ignored unless the -R option is specified. In addition, these options override each other and the command's+
    +     actions are determined by the last one specified.+
    In my terminal I get the following:
    Case 1 - Terminal/Prefences/Window Columns set to 80
    The -H, -L and -P options are ignored unless the -R option is specified.
    In addition, these options override each other and the command's actions
    are determined by the last one specified.
    Case 2 - Terminal/Prefences/Window Columns set to 120
    The -H, -L and -P options are ignored unless the -R option is specified. In addition, these options
    override each other and the command's actions are determined by the last one specified.
    For these tests I closed Preferences and then opened a new Terminal window. Manually widening the windows did not increase text width further but narrowing them resulted in an untidy soft text wrap a character at a time rather than the normal word at a time.
    Am I the only one with a Terminal that does this or does it work for others?

  • Odd behavior when duplicating pages

    I have run into some odd behavior when duplicating pages.
    First I spent many hours trying to acomplish a double trigger effect in which the last trigger opened a large image in a pop up window. Thanks to help from agm 123 and Sachin Hasija  see the posts here: http://forums.adobe.com/message/5186239#5186239
    And the result here: http://ljusa.businesscatalyst.com/stockholm--1.html
    I had to do a number of work arounds, but succeeded and will help anyone interested to reproduce this type of effect.
    My next step was to recreate this effect for another 50 pages. The best way I have found is to duplicate the first page. This is where it gets weird.
    When I create a duplicate and replace the images in the newly created pages (done by changing the fill to the new image) with different ones and save it the changes are effected on the original page, not the clone. No big problem, just switch the names and continue.
    The next problem that occurs is that when I go to make further copies a variety of odd behaviors creep in. The biggest problem is a repositioning or resizing of photo frames/containers. The images do not change, just move as the frame resizes. When I try to resize the frame it snaps back to it's larger new size. This is a phenomenon that I have seen in other instances in work with lightboxes and slideshows. It seems that some other unseen element has jumped into the frame with the original frame.
    The method I have used to create these pages is as described in the post at: http://forums.adobe.com/message/5186239#5186239
    It involves creating a blank composition widget and then placing a composition lightbox widget trigger into the blank hero.
    I have already invested more time than I should have on this and would like to keep it simple, yet as I have 50 pages to go I could start from scratch if someone has a better method of doing this.
    Suggestions?

    Just an update.
    I haven't seen the naming problem with duoplicates reoccur. I am however still stuggling with duplicates.
    I have a page with 5 image frames linked to images which in turn trigger a lightbox. When I create a duplicate of a page there is always at least one of my image frames that moves and or a link to an image that is dead. The only recourse I have had is to recreate one of the lifgtboxes for each new page I create. With all the formatting this is time consuming.
    I have tried copying and pasting the entire page into a blank page, but then there are even more problems.
    I have also tried to save my lightbox as a graphic style, but that dooesn't seem to work either.
    Please Help! I've got at least 45 more of these pages to replicate1

Maybe you are looking for