Questions tagged [service]
A Service is a long-running executable that performs specific functions and which is designed not to require user intervention.
service
23,186
questions
587
votes
14
answers
340k
views
Should a RESTful 'PUT' operation return something....
I was wondering what people's opinions are of a RESTful PUT operation that returns nothing (null) in the response body.
487
votes
10
answers
222k
views
AngularJS : Initialize service with asynchronous data
I have an AngularJS service that I want to initialize with some asynchronous data. Something like this:
myModule.service('MyService', function($http) {
var myData = null;
$http.get('data....
481
votes
8
answers
438k
views
Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058"
When I try to start the ssh-agent on Windows 10 via PowerShell (with elevated right or without) by entering Start-Service ssh-agent I get the error
unable to start ssh-agent service, error :1058
...
388
votes
36
answers
341k
views
Context.startForegroundService() did not then call Service.startForeground()
I am using Service Class on the Android O OS.
I plan to use the Service in the background.
The Android documentation states that
If your app targets API level 26 or higher, the system imposes ...
320
votes
17
answers
156k
views
Difference between targetPort and port in Kubernetes Service definition
A Kubernetes Service can have a targetPort and port in the service definition:
kind: Service
apiVersion: v1
metadata:
name: my-service
spec:
selector:
app: MyApp
ports:
- protocol: TCP
...
281
votes
25
answers
308k
views
How to check if Location Services are enabled?
I'm developing an app on Android OS. I don't know how to check if Location Services are enabled or not.
I need a method that returns "true" if they are enabled and "false" if not (so in the last case ...
280
votes
14
answers
637k
views
How to check if a service that I don't know the name of is running on Ubuntu
I do not know the service's name, but would like to stop the service by checking its status.
For example, if I want to check if the PostgreSQL service is running or not, but I don't know the service'...
269
votes
13
answers
162k
views
startForeground fail after upgrade to Android 8.1
After upgrading my phone to 8.1 Developer Preview my background service no longer starts up properly.
In my long-running service I've implemented a startForeground method to start the ongoing ...
216
votes
20
answers
171k
views
Spring Boot application as a Service
How to configure nicely Spring Boot application packaged as executable jar as a Service in the Linux system? Is this recommended approach, or should I convert this app to war and install it into ...
210
votes
6
answers
167k
views
Call getLayoutInflater() in places not in activity
What does need to be imported or how can I call the Layout inflater in places other than activity?
public static void method(Context context){
//this doesn't work the getLayoutInflater method ...
205
votes
17
answers
107k
views
How do I run a Node.js application as its own process?
What is the best way to deploy Node.js?
I have a Dreamhost VPS (that's what they call a VM), and I have been able to install Node.js and set up a proxy. This works great as long as I keep the SSH ...
205
votes
10
answers
119k
views
Where should @Service annotation be kept? Interface or Implementation?
I'm developing an application using Spring. I need to use the @Service annotation. I have ServiceI and ServiceImpl such that ServiceImpl implements ServiceI. I'm confused here as to where should I ...
202
votes
5
answers
623k
views
How SID is different from Service name in Oracle tnsnames.ora
Why do I need two of them? When I have to use one or another?
201
votes
13
answers
325k
views
Android: How can I get the current foreground activity (from a service)?
Is there a native android way to get a reference to the currently running Activity from a service?
I have a service running on the background, and I would like to update my current Activity when an ...
173
votes
5
answers
85k
views
How do I update the notification text for a foreground service in Android?
I have a foreground service setup in Android. I would like to update the notification text. I am creating the service as shown below.
How can I update the notification text that is setup within ...
166
votes
12
answers
337k
views
How to run a script in the background even after I logout SSH?
I have Python script bgservice.py and I want it to run all the time, because it is part of the web service I build. How can I make it run continuously even after I logout SSH?
148
votes
8
answers
168k
views
Install Windows Service created in Visual Studio
When I create a new Windows Service in Visual Studio 2010, I get the message stating to use InstallUtil and net start to run the service.
I have tried the following steps:
Create new project File -> ...
145
votes
11
answers
256k
views
Android - implementing startForeground for a service?
So I'm not sure where/how to implement this method to make my service run in the foreground. Currently I start my service by the following in another activity:
Intent i = new Intent(context, ...
141
votes
11
answers
153k
views
What is the correct way to start a mongod service on linux / OS X?
I've installed mongodb and have been able to run it, work with it, do simple DB read / write type stuff. Now I'm trying to set up my Mac to run mongod as a service.
I get "Command not found" in ...
140
votes
14
answers
140k
views
What replaces WCF in .Net Core?
I am used to creating a .Net Framework console application and exposing a Add(int x, int y) function via a WCF service from scratch with Class Library (.Net Framework). I then use the console ...
139
votes
38
answers
235k
views
the MySQL service on local computer started and then stopped
the MySQL service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
Can anyone resolve this issue? Thanks.
138
votes
16
answers
231k
views
Run a Java Application as a Service on Linux
I have written a Java server application that runs on a standard virtual hosted Linux solution. The application runs all the time listening for socket connections and creating new handlers for them. ...
136
votes
7
answers
145k
views
How can I configure a systemd service to restart periodically? [closed]
I have a simple systemd service that needs to be periodically restarted to keep its process from bugging out. Is there a configuration option for systemd services to periodically restart them? All of ...
129
votes
6
answers
63k
views
What's the equivalent of Angular Service in VueJS?
I want to put all my functions that talk to the server and fetch data into a single reusable file in VueJS.
Plugins don't seem to be the best alternative. Template less components..?
126
votes
5
answers
329k
views
Start service in Android
I want to call a service when a certain activity starts. So, here's the Service class:
public class UpdaterServiceManager extends Service {
private final int UPDATE_INTERVAL = 60 * 1000;
...
125
votes
9
answers
223k
views
Android: keep Service running when app is killed
I want to keep a IntentService running in background even when the app is killed. And by "killed" I mean press home-button for a long time -> see all running apps -> swipe my app aside -> app killed ...
121
votes
4
answers
122k
views
.aspx vs .ashx MAIN difference
What are the differences between .aspx and .ashx pages?
I use ashx now when I need to handle a request that was called from code and returned with a response, but I would like a more technical answer ...
117
votes
2
answers
237k
views
Start systemd service after specific service? [closed]
I have a general question. How does one start a systemd unit *.service after a particular *.service has started successfully?
More specific question is, how do I start website.service only after ...
116
votes
9
answers
160k
views
Android Starting Service at Boot Time , How to restart service class after device Reboot?
I need to start a service at boot time. I searched a lot. They are talking about Broadcastreceiver. As I am new to android development, I didn't get a clear picture about services on Android. Please ...
112
votes
5
answers
160k
views
Sending a notification from a service in Android
I have a service running, and would like to send a notification. Too bad, the notification object requires a Context, like an Activity, and not a Service.
Do you know any way to by pass that ? I ...
108
votes
1
answer
202k
views
Do the systemctl and service commands exist only on Linux and not on Mac?
I'm trying to see the status of my Apache services on my Mac. I tried the command:
sudo service httpd status
but I get
sudo: service: command not found
I Googled it and discovered systemctl so I ...
103
votes
13
answers
104k
views
Cannot resolve Manifest.permission.ACCESS_FINE_LOCATION
When adding permissions to my manifest file, the below xml works.
<permission android:name="android.permission.ACCESS_FINE_LOCATION" />
However, this xml doesn't work.
<uses-permission ...
103
votes
2
answers
207k
views
Systemd with multiple execStart [closed]
Is it possible to create service with the same script started with different input parameters?
Example:
[Unit]
Description=script description
[Service]
Type=simple
ExecStart=/script.py parameters1
...
100
votes
6
answers
147k
views
Bind service to activity in Android
I'm trying to write a simple media player that plays streaming audio using RTSP. I have a GUI-activity and a service that performs the playback. My question is how to best communicate between the ...
96
votes
7
answers
85k
views
Accessing UI thread handler from a service
I am trying some thing new on Android for which I need to access the handler of the UI thread.
I know the following:
The UI thread has its own handler
and looper
Any message will be put
into the ...
94
votes
15
answers
139k
views
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel
I'm running my Web Project in IIS.
It is a 4.0 Framework APP.
I have a Service.svc and I get this error when I run my Application.
"Could not load type 'System.ServiceModel.Activation.HttpModule' ...
93
votes
4
answers
48k
views
Install Windows Service with Recovery action to Restart
I'm installing a Windows Service using the ServiceProcessInstaller and ServiceInstaller classes.
I've used the ServiceProcessInstaller to set the start type, name, etc. But how do I set the recovery ...
91
votes
9
answers
163k
views
Pass data from Activity to Service using an Intent
How do I get data within an Android Service that was passed from an invoking Activity?
91
votes
3
answers
49k
views
catch on swipe to dismiss event
I'm using an android notification to alert the user once a service is finished (success or failure), and I want to delete local files once the process is done.
My problem is that in the event of ...
91
votes
8
answers
56k
views
Non-Singleton Services in AngularJS
AngularJS clearly states in its documentation that Services are Singletons:
AngularJS services are singletons
Counterintuitively, module.factory also returns a Singleton instance.
Given that there ...
91
votes
14
answers
128k
views
Android Service Stops When App Is Closed
I am starting a service from my main Android activity as follows:
final Context context = base.getApplicationContext();
final Intent intent = new Intent(context, MyService.class);
startService(intent)...
89
votes
3
answers
49k
views
Android - Getting context from a Broadcast receiver onReceive() to send to
I basically want to make an intent and pass it to a service from my BroadcastReceiver's onReceive().
So far I always used View.getContext(), but here, I'm stuck.
How exactly can I get the context so ...
89
votes
3
answers
215k
views
stop service in android
Here I tried simple service program. Start service works fine and generates Toast but stop service does not. The code of this simple service is as below:
public class MailService extends Service {
...
88
votes
2
answers
46k
views
Foreground service being killed by Android
Update: I have not found a true solution to the problem. What I did come up with was a method of automatically reconnecting to a previous bluetooth device anytime the connection is lost. It's not ...
87
votes
10
answers
144k
views
Is Spring annotation @Controller same as @Service?
Is Spring annotation @Controller same as @Service?
I have idea about @Controller which can be used for URL mapping and invoking business logic.
while @Service used to annotate service class which ...
86
votes
5
answers
82k
views
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(...
83
votes
6
answers
118k
views
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 ...
78
votes
4
answers
37k
views
Difference between Systemctl and service command [closed]
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 ...
76
votes
6
answers
58k
views
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 ...
76
votes
9
answers
138k
views
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 ...