Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Sunday, October 14, 2012


How to display logs from android service:

By default,If we added any android service in init.rc, logs are redirected to null device. So logs wont be shown from service. Sometimes it will show sometimes it wont show logs. To display logs always from service,


we have to do the following

service serviceName /system/bin/logwrapper /system/bin/dhcpcd -BKLA -d eth0
disabled
oneshot

/system/bin/logwrapper - this will redirect the  service logs to logcat.

init.rc script is executed by init process.

Thursday, October 04, 2012

How to know the services currently running in Android:

     To list the running services in android

  •   Menu->Setting->Applications->Running Services 

Friday, August 31, 2012


Background Process, Linux:

  if we want to run the process as background,we have to use & symbol.

   bash>./test.sh to run it as foreground service.

 To run it in background,

   bash>./test.sh &

How to run the process as service in linux: [Always up]:

  1) while linux system is in init process, shell files available in /etc/init.d got executed

whenever the system is up,  .profilerc or .bashrc or /etc/init.d/ scripts are executed.
Add your process to run in background

 add below line in your .bashrc or in any /etc/init.d/*.sh scripts
 
  ./MyService &


In Linux, From command prompt, if I want to do some bulk copy,usually I do like this:

 i) in one command prompt, I will perform copy operation
 ii)In another command prompt, I will do other work

We can do the same thing in single command prompt... How to do it ?

 i) run copy operation in background operation
 ii) Continue your work

  >cp bigFolder folderB &
   it will immediately returns to prompt,since copy operation is performed in background.
Next line, I can do any operation.
  >

 Once the copy operation is done, It will show below message in command prompt:

 2+1 cp Done.