Skip to content

Conversation

@arjanoosting
Copy link

.This way there are no zombie ssh processes left around (see https://bugs.php.net/bug.php?id=57918)

@chapeupreto
Copy link

Hi there.
Using fopen() instead of expect_popen() seems to cause the script to be in a forever loop.
Any idea?

@arjanoosting
Copy link
Author

Hi,

Rod Elias schreef op za 13-02-2016 om 05:08 [-0800]:

Using fopen() instead of expect_popen() seems to cause the script to
be in a forever loop.
Any idea?

No, it works fine here. Do you have some code or logging to share?

Regards,

Arjan

@chapeupreto
Copy link

Hello again! Thank you very much for replying me.

I wrote a simple code that only gathers the interface for a subscriber.
When using expect_popen() everything goes fine. The image bellow shows what happen in debug mode:

using-expect

Now, when I execute the same script with fopen("expect://" here is what happen:

using-fopen
For some reason, I'm able to connect to the Junos device but I can't get any output. The script freezes itself as if it were in a forever loop waiting for something else...

There's no log regarding this issue in my php.log file.
I would like to use the fopen approach in order to avoid zombie process.

By the way, why the main code in this repository is still using expect_popen instead of fopen ?

Thanks again for any help!

@arjanoosting
Copy link
Author

I can not see anything strange in the given output. Maybe something with buffering on the stream?
Do you have example code I could try to run against a Juniper here?

I don't know why the code isn't merged yet. I haven't got any response on this pull request yet.

@chapeupreto
Copy link

Hi arjanoosting ,

Please take a look at https://gist.github.com/chapeupreto/e993a905886c448a94a8

When using fopen(), the above script can connect to the device and issue the specified command. However, I noticed that, for some reason, it's unable to close the connection.

I ran it in cli mode and after executing the get-system-users-information RPC call, the prompt doesn't show itself back to the user anymore, as if the script is in a forever loop waiting for closing the connection made to the device.

When the same script is executed via browser I can't see any output (I see just a blank page) and the script keeps running and running...

Any help is much appreciated.

Sincerely,

@chapeupreto
Copy link

Hello @arjanoosting . What's up?
Any update on this please?

@arjanoosting
Copy link
Author

Rod Elias [email protected] schreef op 20 februari 2016 17:35:32 CET:

Hello @arjanoosting . What's up?
Any update on this please?


Reply to this email directly or view it on GitHub:
#16 (comment)

I have been busy. Will look at this tomorrow.
Groeten,

Arjan

@chapeupreto
Copy link

Ok, no problem!
Thanks again.

@chapeupreto
Copy link

Hello again!
Any news?
Thanks!

@chapeupreto
Copy link

Are you still alive? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants