The Following 23 Users Say Thank You to marmistrz For This Useful Post: | ||
![]() |
2012-07-27
, 11:43
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#2
|
invoker: error: Failed to initiate connect on the socket. invoker: warning: Connection with launcher process is broken invoker: error: Start application ... as a binary executable without launcher
// Inits a socket connection for the given application type static int invoker_init(enum APP_TYPE app_type) { int fd; struct sockaddr_un sun; fd = socket(PF_UNIX, SOCK_STREAM, 0); if (fd < 0) { error("Failed to open invoker socket.\n"); return -1; } sun.sun_family = AF_UNIX; //AF_FILE; const int maxSize = sizeof(sun.sun_path) - 1; if(app_type == M_APP) { strncpy(sun.sun_path, INVOKER_M_SOCK, maxSize); } else if (app_type == QT_APP) { strncpy(sun.sun_path, INVOKER_QT_SOCK, maxSize); } else if (app_type == QDECL_APP) { strncpy(sun.sun_path, INVOKER_QDECL_SOCK, maxSize); } else if (app_type == EXEC_APP) { strncpy(sun.sun_path, INVOKER_EXEC_SOCK, maxSize); } else { die(1, "Unknown type of application: %d\n", app_type); } sun.sun_path[maxSize] = '\0'; if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) < 0) { error("Failed to initiate connect on the socket.\n"); return -1; } return fd; }
![]() |
2012-07-27
, 12:20
|
Posts: 1,808 |
Thanked: 4,272 times |
Joined on Feb 2011
@ Germany
|
#3
|
I uploaded version 3.0.3-maemo1. This installs cleanly but there's a runtime error:
The first error is caused by this code:Code:invoker: error: Failed to initiate connect on the socket. invoker: warning: Connection with launcher process is broken invoker: error: Start application ... as a binary executable without launcher
What may be wrong with it?Code:if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) < 0)
The following are general socket errors only. There may be other domain-specific error codes. EACCES For UNIX domain sockets, which are identified by pathname: Write permission is denied on the socket file, or search permission is denied for one of the directories in the path prefix. (See also path_resolution(7).) EACCES, EPERM The user tried to connect to a broadcast address without having the socket broadcast flag enabled or the connection request failed because of a local firewall rule. EADDRINUSE Local address is already in use. EAFNOSUPPORT The passed address didn't have the correct address family in its sa_family field. EAGAIN No more free local ports or insufficient entries in the routing cache. For AF_INET see the description of /proc/sys/net/ipv4/ip_local_port_range ip(7) for information on how to increase the number of local ports. EALREADY The socket is nonblocking and a previous connection attempt has not yet been completed. EBADF The file descriptor is not a valid index in the descriptor table. ECONNREFUSED No-one listening on the remote address. EFAULT The socket structure address is outside the user's address space. EINPROGRESS The socket is nonblocking and the connection cannot be completed immediately. It is possible to select(2) or poll(2) for completion by selecting the socket for writing. After select(2) indicates writability, use getsockopt(2) to read the SO_ERROR option at level SOL_SOCKET to determine whether connect() completed successfully (SO_ERROR is zero) or unsuccessfully (SO_ERROR is one of the usual error codes listed here, explaining the reason for the failure). EINTR The system call was interrupted by a signal that was caught; see signal(7). EISCONN The socket is already connected. ENETUNREACH Network is unreachable. ENOTSOCK The file descriptor is not associated with a socket. ETIMEDOUT Timeout while attempting connection. The server may be too busy to accept new connections. Note that for IP sockets the timeout may be very long when syncookies are enabled on the server.
![]() |
2012-07-27
, 12:50
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#4
|
Not sure how relevant this is, but the length you give to connect as third parameter should be the actual *used* length of the structure, i.e. not sizeof(sun) but rather sizeof(sun.sun_family) + strlen(sun.sun_path).
Also, are you sure that the listening sockets have been created?
Also, instead of just saying if(connect(...) < 0) printf("error") use the perror() function, so that you get the exact reason why connect() failed.
$ man 2 connect
That may help you debugging the problem.Code:The following are general socket errors only. There may be other domain-specific error codes. EACCES For UNIX domain sockets, which are identified by pathname: Write permission is denied on the socket file, or search permission is denied for one of the directories in the path prefix. (See also path_resolution(7).) EACCES, EPERM The user tried to connect to a broadcast address without having the socket broadcast flag enabled or the connection request failed because of a local firewall rule. EADDRINUSE Local address is already in use. EAFNOSUPPORT The passed address didn't have the correct address family in its sa_family field. EAGAIN No more free local ports or insufficient entries in the routing cache. For AF_INET see the description of /proc/sys/net/ipv4/ip_local_port_range ip(7) for information on how to increase the number of local ports. EALREADY The socket is nonblocking and a previous connection attempt has not yet been completed. EBADF The file descriptor is not a valid index in the descriptor table. ECONNREFUSED No-one listening on the remote address. EFAULT The socket structure address is outside the user's address space. EINPROGRESS The socket is nonblocking and the connection cannot be completed immediately. It is possible to select(2) or poll(2) for completion by selecting the socket for writing. After select(2) indicates writability, use getsockopt(2) to read the SO_ERROR option at level SOL_SOCKET to determine whether connect() completed successfully (SO_ERROR is zero) or unsuccessfully (SO_ERROR is one of the usual error codes listed here, explaining the reason for the failure). EINTR The system call was interrupted by a signal that was caught; see signal(7). EISCONN The socket is already connected. ENETUNREACH Network is unreachable. ENOTSOCK The file descriptor is not associated with a socket. ETIMEDOUT Timeout while attempting connection. The server may be too busy to accept new connections. Note that for IP sockets the timeout may be very long when syncookies are enabled on the server.
The Following User Says Thank You to marmistrz For This Useful Post: | ||
![]() |
2012-07-27
, 13:05
|
Posts: 1,808 |
Thanked: 4,272 times |
Joined on Feb 2011
@ Germany
|
#5
|
![]() |
2012-07-27
, 13:30
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#6
|
Don't see how this could be a problem, but who knows, Maemo is an absolute mess thanks to the "optification".
What values do all those INVOKER_*_SOCK variables (or #defines, whatever they are) have?
Do the sockets actually exist where they are expected to exist?
But again, your best friends are, at the moment, errno and perror(). They will tell you all you need to know.
The Following User Says Thank You to marmistrz For This Useful Post: | ||
![]() |
2012-07-27
, 15:14
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#7
|
#define INVOKER_M_SOCK "/tmp/boostm" #define INVOKER_QT_SOCK "/tmp/boostq" #define INVOKER_QDECL_SOCK "/tmp/boostd" #define INVOKER_EXEC_SOCK "/tmp/booste"
The Following User Says Thank You to marmistrz For This Useful Post: | ||
![]() |
2012-07-30
, 08:07
|
Posts: 1,808 |
Thanked: 4,272 times |
Joined on Feb 2011
@ Germany
|
#8
|
I just noticed that files in /tmp (INVOKER_*_SOCK) - as it's -
don't exist at all. But touching these files doesn't work. Still the errorCode:#define INVOKER_M_SOCK "/tmp/boostm" #define INVOKER_QT_SOCK "/tmp/boostq" #define INVOKER_QDECL_SOCK "/tmp/boostd" #define INVOKER_EXEC_SOCK "/tmp/booste"
The Following 4 Users Say Thank You to reinob For This Useful Post: | ||
![]() |
2012-08-08
, 07:58
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#9
|
I don't know what exactly you're trying to do. The nice thing about Unix and derivatives (Linux) is that (almost) everything is represented as a "file", even though some things are not files in the common sense of the word.
A unix socket is an example of that. It looks like a file you can open, read and write to, but it is not a file. So touch'ing it makes no sense. touch will create a (real) file of zero size.
Presumably you'd need to run the program that actually creates those sockets and listens (binds) on them.
I don't know what applauncher does, nor do I care. I suspect it's one of those over-complicated "abstraction layers" that supposedly bring nice effects (splash screen? single instance? what has happend to Linux?!) where actually they only make everything more complicated to understand as well as contributing to the dependency hell we're living in.
If you really want to port applauncher to Fremantle I'd recommend that you debug your program using the perror() function. Really, it's the best thing you can do at the moment to diagnose the situation.
If Harmattan programs actually *require* this contraption, I would recommend you make a dummy/fake applauncherd so that programs can be run like normal programs. Then the user would be able to install the real "thing" or the fake one (hint: "provides", "conflicts", since we're playing the debian game).
Good luck anyway!
![]() |
2013-09-29
, 18:13
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#10
|
invoker: Invoking execution: '/opt/SzybkiDemot/bin/SzybkiDemot' invoker: error: Can't send signal 11 to application [10043]: No such process
Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem Object::disconnect: Unexpected null parameter Daemon: select done. Daemon: FD_ISSET(m_boosterLauncherSocket[0]) Daemon: booster type: d Daemon: invoker's pid: 10046 Daemon: respawn delay: 3 Daemon: socket file descriptor: 12 Daemon: select done. Daemon: FD_ISSET(m_sigPipeFd[0]) Daemon: SIGCHLD received. Daemon: Terminated process had a mapping to an invoker pid Boosted process (pid=10043) was terminated due to signal 11 Daemon: Booster (pid=10043) was terminated due to signal 11 Daemon: Killing invoker process (pid=10046) by signal 11.. Daemon: Killing pid 10046 with 11 Daemon: Running a new Booster of type 'd' Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem
I'd like to announce that I ported applauncherd to Maemo Fremantle.
It's available in extras-devel, I hope it'll work smoothly.
Applauncherd port is a part of MeeCoLay project.
Download:
Thanks to:
Source is available here: https://meego.gitorious.org/~marmist...o-applauncherd
Why do we need it? We have limited RAM in Fremantle, and applauncherd saves it - shares the libraries between apps.
If you want to support my work, you can donate by PayPal or Flattr
Projects no longer actively developed: here
Last edited by marmistrz; 2013-09-30 at 18:32.