0

I would like to run an inetd server on my rooted phone to accept incoming connections and launch an application in response. I've installed BusyBox since it includes inetd and I created a file /etc/inetd.conf/myApp with the contents:

service myApp
{
    socket_type = stream
    protocol = tcp
    wait = no
    user = root
    server = /system/app/com.mydomain.myApp-33.apk
    port = 2345
    disable = no
}

I then ran this command from the adb shell:

shell@jfltevzw:/ $ su
root@jfltevzw:/ # busybox inetd -q 2345 /etc/xinetd.d/myApp

I then tried to test by using telnet from my Macintosh:

bash-3.2$ telnet 192.168.1.29 2345
Trying 192.168.1.29...
Connected to android-1c7bde8dccfe2a27.
Escape character is '^]'.
Connection closed by foreign host.

I tried other not-configured ports (e.g. 2346) and get the same result, so it is failing at a very basic level and not getting very far at all.

How can I see any log files to figure out what is going wrong?

2

You seem to mix up inetd and xinetd configuration and paths - use a config for one or the other. You may also want to consider to specify the service as type "unlisted" to avoid the need of it being added to /etc/services - as you didn't mention you did add your service, I suppose you didn't.

| improve this answer | |
  • 1
    Correct, service is not registered for its ports. Please elaborate on what you mean by mixing up inetd and xinetd configuration and paths - use a config for one or the other. – WilliamKF Jul 31 '15 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.