Questions tagged [service]

A Service is a long-running executable that performs specific functions and which is designed not to require user intervention.

A Service is a long-running executable that performs specific functions and which is designed not to require user intervention.

Services usually provide an interface to Start, Stop, Pause and Restart the executable that is running in the computer's background.

23127 questions
84
votes
5 answers

Service Intent must be explicit: Intent

I have an app some time now in which I call a service through a broadcast receiver (MyStartupIntentReceiver). The code in the broadcast receiver in order to call the service is: public void onReceive(Context context, Intent intent) { Intent…
duk3r
  • 1,174
  • 2
  • 12
  • 16
81
votes
6 answers

Unable to start Service Intent

I have a service class. I have exported this class to jar and I have embed the jar in my client app. When needed, I call the service class. When I try to do this, I get the following error: Unable to start service Intent…
Vinay
  • 2,395
  • 3
  • 30
  • 35
76
votes
4 answers

Difference between Systemctl and service command

I always run my Apache server in this way: sudo service apache2 start But in many guides I saw commands like this: sudo systemctl start apache2 Can somebody shortly write the difference between these commands and give me advice about what command…
Roman Romanov
  • 896
  • 1
  • 7
  • 8
75
votes
7 answers

Get GPS location via a service in Android

I need to monitor user's locations using a background service, and then load them and show the path to the user. Using an activity, it was quite easy to get GPS locations, but when I got to do it via a service, I came into a problem as it seems to…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
75
votes
6 answers

Why is this simple service not starting?

I have a service with a handler that has to write "Hello" in the logcat every 5 seconds. But it doesn't write nothing on the logcat... It's like the service is not executing, and I put a breakpoint on it and the debug mode never stops on the…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
75
votes
9 answers

Android Service needs to run always (Never pause or stop)

I created a service and want to run this service always until my phone restarts or force closed. The service should run in background. Sample code of created service and start services: Start the service: Intent service = new…
74
votes
1 answer

Cannot find IIS Service in Windows 7

When I go to the windows services window in Windows 7 (Start ==> Administrative Tool ==> Service), I can't find IIS Service listed! Am I missing something? I just want to restart the service. I have IIS Manager and can open it. Any help is much…
user1034912
  • 2,153
  • 7
  • 38
  • 60
72
votes
11 answers

How to start and stop android service from a adb shell?

I need to write a shell script to start and stop an android service .
ranjitrock
  • 721
  • 1
  • 5
  • 3
72
votes
2 answers

Python script as linux service/daemon

Hallo, I'm trying to let a python script run as service (daemon) on (ubuntu) linux. On the web there exist several solutions like: http://pypi.python.org/pypi/python-daemon/ A well-behaved Unix daemon process is tricky to get right, but the…
tauran
  • 7,986
  • 6
  • 41
  • 48
71
votes
3 answers

Are there any constantly updating RSS feed services to use for testing, or just very active RSS feeds?

I'm trying to test a service that consumes RSS feeds and turns them into push notifications, and it would be nice if there was a very regularly updated publicly available RSS feed I could point it at. I know I can just use a news feed like CNN, but…
mgnb
  • 2,803
  • 2
  • 16
  • 15
69
votes
1 answer

How to set up a systemd service to retry 5 times on a cycle of 30 seconds

I want systemd to start a script and retry a maximum of 5 times, 30s apart. Reading the systemd.service manual and searching the Internet didn't produce any obvious answers.
jross
  • 1,847
  • 2
  • 10
  • 6
67
votes
1 answer

Unable to run a service command via cron

service service_name start When i tried running this from cmd line, it works. But when i try to schedule it via cron, i get an error saying /bin/sh: service: command not found
Ash
  • 693
  • 1
  • 6
  • 9
67
votes
7 answers

How can I extract "Path to executable" of all services with PowerShell

Get-Service *sql* | sort DisplayName | out-file c:/servicelist.txt I have a one line PowerShell script to extract list of all services running on my local machine, now, in addition to displaying "Status", "Name" and "DisplayName" I also want to…
Abilash A
  • 951
  • 2
  • 8
  • 14
65
votes
4 answers

Using ResultReceiver in Android

Fundamentally, I would like to establish a callback to an Activity from an IntentService. My question is very similar to the one answered here: Restful API service However, in the answer code, the activity code is seen as implementing a…
Bill Eisenhauer
  • 6,183
  • 2
  • 30
  • 28
65
votes
4 answers

Cloud Foundry explained

So I've been reading up on Cloud Foundry and yet I'm still confused as to what it is. Here is my take anyway on PaaS on CF, and hopefully you guys could tell me if I'm wrong and explain it a bit better. A traditional PaaS offering like Microsoft…
Amoeba
  • 1,573
  • 4
  • 19
  • 25