how to disable iGnss in android system - android-service

I'm debugging Gnss service in ANDROID 9 system on my platform. i dont compile android/hardware/interfaces/gnss,so this service should be not started. But when the system is booting up, i see this log:
init: Received control message 'interface_start' for
'android.hardware.gnss#1.1::IGnss/default' from pid: 1065
(/system/bin/hwservicemanager) init: Could not find service hosting
interface android.hardware.gnss#1.1::IGnss/default init: Received
control message 'interface_start' for
'android.hardware.gnss#1.0::IGnss/default' from pid: 1065
(/system/bin/hwservicemanager) init: Could not find service hosting
interface android.hardware.gnss#1.0::IGnss/default
why gnss service was started, not like my expected is not started.
Anyone can help disable this service, or show me where gnss was initialized. i dont want start this gnss when system booting up.
Thanks.

It is not that gnss service is started. You see the error message because gnss service is not started and the framework is expecting some service which could serve gnss interface. To get rid of this error message you need to provide a service ( hal implementation) that serves gnss interface. The default implementation should do this job unless there is another implementation that overrides default one but doesn't serve 1.0 and 1.1 interface.
I have an implementation that overrides the default one but provides only 1.0 interface so the error message I see is only for 1.1 interface. I am trying to adapt my implementation to support 1.1 interface also. Hope that'll solve the problem.
Since your question was asked long back, please share if you already have a solution.

Related

How to connect to ActiveMQ on startup with WCF and IIS

What is the best way to combine a single instance WCF service that uses ActiveMQ and runs within IIS/AppFabric?
Our Services need to support both HTTP transports and ActiveMQ (listening and sending messages). We've elected not to use MSMQ, and will use Spring.Net.NMS. The fundamental issue I have now is that ActiveMQ needs to connect to the queue(s) at startup and remain connected, but WAS is getting in the way with it's message-activation feature. If the service is not activated until a message arrives (HTTP/MSMQ, etc) then there is no trigger to have the connection to AMQ occur.
I know I can disable the recycling behavior, and I know I can do self-hosting with a Windows Service. But I want to take advantage of the monitoring and other features in AppFabric. I've already been down the route with IServiceBehavior and will use that for other nice things. But that interface is not called until a (non-AMQ) message arrives. So it won't work for this. What I was hoping for was something along the line of how ServletContextListeners work in Java, where you get both the start up and shutdown events. But it seems no such thing exists in WAS... it is driven only by messages arriving.
I've scoured every inch of web info for 3 days and the only thing I came across was to use a static class construction (C#) trick as the trigger. That's a hack, but i can live with it. It still leaves the issue of cleanly shutting down, which I can figure out later.
Anyone have a solid solution to this?
The direct WCF support for ActiveMQ that Ladislav mentions is still being supported. There just hasn't been an official release for the module in a while. However, you can still get the latest version of it from the 1.5.x branch or trunk and compile it yourself.
1.5.x branch for use with Apache.NMS 1.5.0:
https://svn.apache.org/repos/asf/activemq/activemq-dotnet/Apache.NMS.WCF/branches/1.5.x/
Check out instructions:
http://activemq.apache.org/nms/source.html
There was direct WCF support for ActiveMQ but I guess it is not developed anymore. Your problem actually is the IIS / WAS (provides hosting for non-http protocols) hosting architecture. Services in WAS are always activated when message arrives - there is no global startup. The reason for this is that WAS hosting expects that there is separate process (windows service) running the listener all the time and this process has adapter which calls WAS and uses message level activation. I guess you don't have such process for ActiveMQ and because of that you will have trouble to use ActiveMQ endpoint hosted in WAS. Developing such listener can be challenging task (example for UDP).
Creating custom listener can be probably avoided by using IIS 7.5 / AppFabric auto start feature. There is also not very well documented way to run the code when the application starts.

Error in log after windows restart when subscriber is installed as a service

I'm using NserviceBus 2.0 with pub/sub mode.
My subscribers are installed as a windows service.
However after computer restart I always get the following problem in log : "Problem in peeking a message from queue: ServiceNotAvailable".
After digging into source code I found that this is NserviceBus custom error and it occurs in MsmqTransport class. It seems like my subscriber's service is started before Msmq service. Bus this should be impossible because subscriber's service has Msmq as dependency.
After some time service is starting and working correctly. But I have several megabytes of errors in log. And sometimes service is not even starting.
Can anyone help me? I'm using Windows 7. Msmq is installed with NserviceBus utils.
You need to configure your service to be dependent on the MSMQ service. This is should be automatically taken care of if you're using the NServiceBus host.
Installing a Windows Service with dependencies
Have seen the same problem. Actually the impact was even worse since we used log4net and SmtpAppender. Took down the mailserver, ouch! Seems like this is fixed in NSB 3. It sets number of workerthreads to zero and logs "please reboot service". You can even execute own code when the error occurs. Config with lambda using OnCriticalError. We ended up patching the NSB 2 code, since we havent upgraded to NSB 3 yet. Handling MSMQExceptions, logging and stopping the process on errorcode ServiceNotAvailable like they already do when you don't have correct rights to queue. You should probably stop the service on any MSMQExceptions exept IOTimeout.

Windows service connecting to other service over wcf crashes

I have two windows services. One ('server') acts as a WCF host to which the other ('client') connects. So I have configured a dependency from client to server. Both are also set up to start automatically.
When I start these services by hand, everything works fine. When I stop both services and tell client to start, then server will be started before client and all is fine.
However, when I reboot the machine only server is started.
When I add a diagnostic listener I see it got a TimeoutException with the helpful message:
The HTTP request to 'http://[server address]' has exceeded the allotted timeout of 00:00:00. The time allotted to this operation may have been a portion of a longer timeout.
At some other SO question there was an answer that claims WCF is probably confused about what went wrong and therefore starts lying about the timeout.
Did I perhaps miss a dependency for either service? Does WCF require something that hasn't or is being started when client is trying to contact server?
I think you should check your client service. On startup windows services are starting while network devices are still being initialized. Services should be ready to start without network and without any network device. Usual approach is to keep periodic retries to establish connection. You can do little experiment on your machine by uninstalling all network adapters and trying to start up your services.
Additional quick workaround you can do is to setup recovery options on your service -- for example you can configure it to restart service on crash after some timeout -- you can do this through UI in services.msc or in command line using 'sc config' command.
Configuring the dependency between the two Windows Services is not necessarily sufficient to avoid there being a race condition: i.e. to avoid the client service calling the WCF service before the server's WCF channel stack is fully initialised.
The service dependency just ensures that the Windows Service Control Manager won't start the client service process before the server Windows Service has notified the SCM that it has started. Whether this is sufficient depends on how you write the server.
If the server service starts a new thread on which to initialize the WCF stack, your OnStart method is probably returning before the WCF stack is ready for clients. There is then a race condition as to whether the client's first call will succeed.
On the other hand, if the server service does not return from OnStart (and thus doesn't notify the SCM that it has started) until the channel stack is fully open, the dependency removes the race condition, but there is a different pitfall: you need to beware that the SCM's own timeout for starting the Windows service is not triggered while waiting for the WCF stack to initialise, as might well happen on a reboot if the WCF service depends on the network stack, for example. If the server's OnStart does not return within the SCM's timeout, the SCM will not try to start the dependent client service at all, because it does not receive the server's start notification. (There will be a message in the Windows event log from the SCM saying that the server service didn't start within the expected time.) You can extend the SCM timeout by calling ServiceBase.RequestAdditionalTime while the WCF service is being initialised.
Either way, the client service really ought to be written so that it doesn't fail completely if the first WCF call doesn't succeed.
You don't actually say what binding you are using. If client and server services are always running on the same machine, as you seem to indicate, then consider using the NetNamedPipeBinding: then your service won't be dependent on initialization of networking resources and startup should be quicker.

Do you need to open client firewall for WS-AT to work with WCF?

I am getting the following error trying to communicate from WCF -> WCF across the internet with a SSL certificate. I have 'No authentication required' checked in the WS-AT configuration on the server.
After a few seconds I'm getting the following message on my client, and trying to figure out what is wrong in my configuration (or understanding of WS-AT).
The flowed transaction could not be
unmarshaled. The following exception
occurred: The WS-AtomicTransaction
protocol service could not unmarshal
the flowed transaction. The following
exception occured: A fault reply with
code CoordinatorRegistrationFailed was
received. The fault reason follows:
The WS-AT protocol service failed to
register with its coordinator. A
connection could not be established.
Looking at the log file on the server I find a link to http://msdn.microsoft.com/en-us/library/aa702582(VS.90).aspx and the following trace message
Microsoft.Transactions.TransactionBridge.RegistrationCoordinatorFailed
Traced if the local TransactionManager is not able to
Register with its superior
TransactionManager due to the
inability to send a message.
So I'm wondering... is the server attempting to communicate with the client through a different channel to the SSL connection originally established by the client. I'm pretty sure thats what it's trying to do for me to end up with this message. The client is my laptop (currently in Starbucks) so there's no chance of any incoming connections.
So is it possible to use WS-AT transactions where only the server has an open firewall? Assuming it is possible - what do i have to do to allow for it? I'm finding very little information about necessary configuration - even in my massive Programming WCF book .
Bonus: Here's a few small tips for anyone trying to get WS-AT working :
If when trying to install the WS-AT tab you can't get it to appear - and you're running an x64 operating system - make sure you're using the x64 version of RegAsm.exe:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase wsatui.dll
If once installing WS-AT, configuring it for incoming connections and restarting MCAT you still get errors about the protocol being disabled you may have forgotton to restart IIS(!)

WCF service does not respond, how to debug?

consider a WCF service, which is heavily used and behaves normally. But then is stopps responding. In the sevice level message trace you can see the outgoing message on the client, but no incoming message on the server. On transport level theres a incoming message and then nothing. After 60 seconds the client throws a TimeoutException.
What can cause a behavior like this?
What would you do to debug this behavior?
Is it possible that this behavior is caused by too many concurrent connections/sessions?
EDIT:
Client and Server are on the same machine. Both are .NET apps. When the client is restarted the problem sometimes does not happen. Also the problem does only appear on a single machine. I was not able to reproduce the behavior on any other machine.
Regards
Michael
I understand you have no problem on network level as you have mentioned that you can see incoming request on transport level.
So the first thing to check does the service is up and does it works if the client is on the same machine.
Also you can analyze incoming messages may be the problem can be there.
Here WireShark will be your friend.
Also check can you view the wsdl from the client machine. By the way are your clients also .NET apps?
You can configure tracing using the application’s configuration file—either Web.config for Web-hosted applications, or Appname.config for self-hosted applications by Service Trace Viewer
or use from debug tools such Debug Diag