Menu

#3 What is the meaning of ndsad return codes?

open
nobody
None
5
2006-01-09
2006-01-09
Anonymous
No

Hello.

When I run ndsad -d ndsad starts and detaches from
terminal, but return code is 1. Do I have an error in
configuration file?

TFYT

Discussion

  • Nobody/Anonymous

    Logged In: NO

    If you see function:

    int daemonize() {
    int pid = fork();
    if( pid < 0 ) {
    // Error
    DEB(__rep_error( "daemonize" , 0 ));
    return 0;
    } else if( pid ) {
    // Parent
    return 0;
    } else {
    // Child - have to log it.
    writelog( "Child process started." );
    return 1;
    }
    }

    return code 1 is not fatal return code. Don't worry about
    config file.

     
  • Nobody/Anonymous

    Logged In: NO

    Yes. I saw that code ;)

    The problem I see here, that such behaviour is not standart
    for unix systems. I think that if program does not encounter
    any problems, return code should be 0. In trouble it should
    be non zero.

    What do you think about this?

     

Log in to post a comment.