Exit codes from dgate

  • Marcel

    Did the exit codes for commands submitted to dgate change between 1.4.19c and 1.5.0.b ? I know this is kind of an odd question but here's what I'm seeing

    when doing something like the below from the command line


    $> ./dgate --get_amaps:%s,%s,%s,%s

    (the above command returns somthing like the following)

    ANAETITLE,127.0.0.1,8181,un


    $> echo $?


    on a centos 7.6 system with 1.4.19c I'm receiving an exit code of 0 from bash... which indicates success.

    Doing the same command on a debian buster system with 1.5.0.b results in an exit code of 255.


    Just wondering if you knew why this was happening between the systems


    Thanks in advance


    Mr Johnathan Bravo


    P.S. trying to do some bash scripting with dgate and was hoping to use the exit codes to determine success or failure of the command

  • Here is a list of error codes:


    server out of memory --> 1

    server not configured --> 1

    any -letter command failed --> 1

    setup command failed --> 1

    database created --> 0

    --dolua returns 0

    server quiting do to --quit or --safequit: returns 0

    CGI processing returns 0

    startup converter calls reject: return 1

    -- commands return:

    return value of servercommand

    which is 0 on success (command succesfully sent - not necessarily succeeded)

    which is 1 if cannot connect

    it is atoi of the return buffer if it is less than 100 characters

    it is -1 if a buffer is succesfully returned

    I think this changed end 2018


    So yes, 255 (-1) is likely also success. I needed the return code internally. If you want I can force if back to zero before calling exit()


    You can force a given return code in lua.


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!