service

init warning: Service myservice needs a SELinux domain defined. Please fix

[亡魂溺海] 提交于 2021-02-19 01:18:53
问题 I want to excute an executable on boot On a target board with Android 5.1 so I add this in init.rc: on boot start myservice service myservice /system/bin/myservice #class main user root group root #oneshot I did the unpack and repack job. When changes are made, however, the screen keeps printing: init warning: Service myservice needs a SELinux domain defined. Please fix. type=1400 ... avc:denied ... scontext ... tcontext ... #some annoying warning messages like this SELinux seems a huge

Broadcast receiver working even after app is killed by user

纵然是瞬间 提交于 2021-02-18 15:30:11
问题 I have a BroadcastReceiver that checks for network connection declared statically as: <receiver android:name=".core.util.NetworkChangeReceiver" android:label="NetworkChangeReceiver"> <intent-filter> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> <action android:name="android.net.wifi.WIFI_STATE_CHANGED" /> </intent-filter> </receiver> Network change receiver does something like: public class NetworkChangeReceiver extends BroadcastReceiver { @Override public void onReceive

Android listen for messages from server socket

ε祈祈猫儿з 提交于 2021-02-17 20:08:23
问题 I am trying to create an android app that communicates with a local server through a socket. The communication passes simple commands and data in strings using JSON. The client should constantly listen to incoming messages from the server and update the user interface when new data is received. So i have created a network service which is a bound service running in the background. From my activity i bind to the service and receives an instance of the service object. The service object

Android listen for messages from server socket

拥有回忆 提交于 2021-02-17 20:06:46
问题 I am trying to create an android app that communicates with a local server through a socket. The communication passes simple commands and data in strings using JSON. The client should constantly listen to incoming messages from the server and update the user interface when new data is received. So i have created a network service which is a bound service running in the background. From my activity i bind to the service and receives an instance of the service object. The service object

Android listen for messages from server socket

被刻印的时光 ゝ 提交于 2021-02-17 20:06:25
问题 I am trying to create an android app that communicates with a local server through a socket. The communication passes simple commands and data in strings using JSON. The client should constantly listen to incoming messages from the server and update the user interface when new data is received. So i have created a network service which is a bound service running in the background. From my activity i bind to the service and receives an instance of the service object. The service object

How to sent text string to service?

帅比萌擦擦* 提交于 2021-02-17 06:41:33
问题 I have a desktop application and a service. How can i send string from desktop application into my service and handle it in a service? I don't want use sockets because it may be blocked by Windows Firewall. 回答1: If you don't want to use network transport then probably the simplest way to do cross-session IPC is to use a named pipe. The main thing to take care over is that you will need to supply security attributes when creating the named pipe. Without doing so you won't succeed in cross

Tomcat Service gets installed with “Local Service” account

冷暖自知 提交于 2021-02-16 18:22:07
问题 Post Tomcat 8.0.53, when I install Tomcat (9.0.30 or 8.5.50) and install it as service (Using service.bat), it gets installed but with "Log on" as "Local Service" instead of "Local System account". This can be seen under services in windows. Because of this, when I run the service, the application is not able to read a file. If I manually go to services, open properties for my service, then change the Log on as "Local System" and save, everything works perfectly. Why does this happen for

How to execute ESRI Leaflet map in PHP as a windows service

不打扰是莪最后的温柔 提交于 2021-02-11 17:01:02
问题 I have Created an Esri-leaflet map using (Esri-leaflet CDN from Esri leaflet GitHub repository) which plots markers and also written code to get the image exported with markers on page load and is saved as PHP file, Now I want to run this file as a service so that the code keeps running in the background and keep generating images even after a system reboot. I have tried to execute with cmd but only the code is shown up but not executed. If anyone can find a solution much-appreciated Thanks

GetCurrentDirectory does not really return the path of the executable file

核能气质少年 提交于 2021-02-11 15:57:44
问题 I am coding a program as service using c++, when I test it as a normal program, the function GetCurrentDirectory returns the correct path. But when I try to install my program as service, GetCurrentDirectory returns C:\Windows\System32 instead of the path of the executable. How can I get the path of my executable file in a way that will work for a service? 回答1: Working directory for Windows services is always %WINDIR%\System32 . To get directory, where your executable resides, simply call

WTSIsRemoteSession always returns TRUE

我们两清 提交于 2021-02-11 12:22:24
问题 I'm currently writing a Windows service, which also does something when a user logs on. There was the idea to do nothing if the logon comes from a remote computer (e.g. Remote desktop), and tried to find a way to dermine this. But following does not work - it always returns true (Windows 10 64 bit V1809) - is there something I doing wrong here? DWORD SvcHandlerEx(DWORD controlCode, DWORD eventType, ... ) { ... switch(controlCode) { case SERVICE_CONTROL_SESSIONCHANGE: { WTSSESSION_NOTIFICATION