mounting via cgi -> problems

hi guys…

on my server there is running qnx 6.x with slinger as http-server.
on my testing-workstation there is winxp.

now i am trying to mount some directory of my wiorkstation on the server by using a cgi-script in c. but the effect is error 256 (socket is already connected).

when i try to mount via telnet (using the same command) it works without problems.

does anybody know the problem??

here’s some sample-code of the cgi script:

errno = system("fs-cifs //Schesslitz:62.8.229.53:/QNX /mnt/qnx user passwd");
cout << strerror(errno) << endl;

so…now after some testing i can describe the problem some better:

i know now that he mounts when the script makes
system(“fs-cifs //Schesslitz:62.8.229.53:/QNX /mnt/qnx user passwd”);

but after doing this he umounts immediately…so there is no connection any more.
but still there is always errno = 256 in every try i did.

  1. Your intepretation of the return code from system may not be correct. Check the docs.

  2. You may want to write a simple shell script that wraps the “fs-cifs” command and put some sleeps in there. Your system() can then call the scripts. You can have more flexibility in your “script” where you can put more logging for troubleshooting.

so i tried this using code like this:

rc = system(cpCommand);
    if( rc == -1 )
    {
    	printf( "shell could not be run\n" );
    }
    else
    {
    	printf( "result of running command is %d\n", /*WEXITSTATUS rc)*/ rc );
    }	

but there is still error 256 :frowning:

what’s wrong in there??

i also tried to make something like this, but it doesn’t work…:frowning:

Put a “sleep 60” after the “fs-cifs” in your “script”.
Open another terminal and check the mount while it is sleeping.

hi noc…

no i tried several times to mount and make a “sleep xx” after different commands i use for mounting. but always with the same result:
there is no effect…

fs-cifs is always done well and running after being activated, but the real mount with the command:

mount -t cifs -o rtc,123456 //name:ip/qnx /mnt/qnx

never works! it’s only active in the moment, when the command is performed.

how could i know this.
i made some loop, always mounting für about 500 times and making “pidin a” on the telnet terminal the same time…

so i ask again:
why can i mount without any problems on the telnet terminal, but byusing my script there are so many problems??

nevertheless thanx for your help!

Does the script work from the telnet terminal?
Post your script?

Another possibility could be the signal killed it. Maybe you can try adding a “nohup”.