windows-services

Play Framework 2 Stage Task on Windows, “The input line is too long”

心已入冬 提交于 2019-11-28 09:01:24
I'm trying to Play 2 application on Windows Server Server 2012 using the " stage " task, with the goal of wrapping this up in a service so the application will automatically run when the server gets restarted. However, when running the app I get the following message: The input line is too long. The syntax of the command is incorrect. This is because Windows has a limit of around 8000 characters for command line instructions but it seems like the Play stage command is exceeding this by passing the classpath as an argument. Copying the "stage" folder to c:\ might fix the issue (as it'll reduce

JavaExe and Java application as windows system service interactive to desktop

让人想犯罪 __ 提交于 2019-11-28 08:57:18
问题 Request: This is a very common problem faced by Java devs in my locale. I am really stuck for many days on this. Searched and tried a lot, read the docs. read ALL the stackoverflow questions related to JavaExe. Please only reply if you have done similar thing before and have a comprehensive answer. I would be really grateful to the community! Senario: I am using JavaExe to run an application as system service in desktop interactive capability. To be exact I have an application that captures

Always Running Threads on Windows Service

为君一笑 提交于 2019-11-28 08:48:11
I'm writing a Windows Service that will kick off multiple worker threads that will listen to Amazon SQS queues and process messages. There will be about 20 threads listening to 10 queues. The threads will have to be always running and that's why I'm leaning towards to actually using actual threads for the worker loops rather than threadpool threads. Here is a top level implementation. Windows service will kick off multiple worker threads and each will listen to it's queue and process messages. protected override void OnStart(string[] args) { for (int i = 0; i < _workers; i++) { new Thread

How to Read Custom XML from the app.config?

为君一笑 提交于 2019-11-28 08:38:29
I want to read the custom XML section from the app.config of a C# windows service. How do I go about it? The XML is below: <Books> <Book name="name1" title="title1"/> <Book name="name2" title="title2"/> </Books> What you want to do is read up on Custom Configuration Sections . Kevin Nisbet In a project I developed I use something similar for configuration that I found. I believe the article was called the last configuration section handler I'll ever need (I can't find a working link, maybe someone can link it for me). This method takes what you want to do one step further, and actually de

How do I retrieve the username that a Windows service is running under?

大憨熊 提交于 2019-11-28 08:24:36
Given a service name, I would like to retrieve the username that it runs under (i.e. the username shown in the 'Log On' tab of a service's properties window). There doesn't appear to be anything in the ServiceController class to retrieve this basic information. Nothing else in System.ServiceProcess looks like it exposes this information either. Is there a managed solution to this, or am I going to have to drop down into something lower-level? Riaan Using WMI, with the System.Management you can try the following code: using System; namespace WindowsServiceTest { class Program { static void Main

Starting remote Windows services with ServiceController and impersonation

时光总嘲笑我的痴心妄想 提交于 2019-11-28 08:03:04
问题 I have a .NET MVC3 application that needs to be able to turn a remote service on and off. In order to do this I am impersonating a specific user account via WindowsIdentity.Impersonate(). To test the user's permissions I can log in as the user and execute sc.exe \\[server] start [service] from the command prompt. I also know that the impersonate command is working as expected because the application runs anonymously and therefore cannot control services on my local machine ( . ) without

Can't debug Java Windows Services with jhat, jps, jstack

徘徊边缘 提交于 2019-11-28 07:39:19
I frequently showcase the jhat, jps , and jstack tool set to developers on Linux and Mac. However, a developer recently indicated that these are unusable in Windows if the Java app in question is running as a Windows Service . A Sun-filed bug says something very similar , but was closed due to inactivity. I have tested this out for myself, and indeed it appears true, though I can hardly believe it. Here is the setup: Tomcat or similar running as a Windows service with the "Log On As" == "Local System" A user with Admin privileges logged in to the same Windows machine. Admin opens Windows Task

System.Timers.Timer How to get the time remaining until Elapse

ε祈祈猫儿з 提交于 2019-11-28 07:27:59
Using C#, how may I get the time remaining (before the elapse event will occur) from a System.Timers.Timer object? In other words, let say I set the timer interval to 6 hours, but 3 hours later, I want to know how much time is remaining. How would I get the timer object to reveal this time remaining? The built-in timer doesn't provide the time remaining until elapse. You'll need to create your own class which wraps a timer and exposes this info. Something like this should work. public class TimerPlus : IDisposable { private readonly TimerCallback _realCallback; private readonly Timer _timer;

error 1083 the executable program that this service is configured to run does not implemented the service

杀马特。学长 韩版系。学妹 提交于 2019-11-28 07:18:37
问题 getting error while try to start service 回答1: answer: if you are getting this error check the service name and service process installer service name. Both must be the same. happy coding Source: http://cut.lu/cddc2c 回答2: Also ensure that in the entry point for the exe (usually the Main procedure) an instance of the your service class (that derives from Service base is created).eg. private static void Main() { var servicesToRun = new ServiceBase[] { new MyService1(), new MyService2() };

Is it possible for a Windows service impersonate a user without a password?

谁说我不能喝 提交于 2019-11-28 07:04:49
Is it possible for a C# Windows service running as Local System or Local Service to impersonate another user without needing a password for that user ? How would this be done? Note: My motivation for this is to be able to run user specific WMI queries in a service. The WMI calls I'm making (to the OfflineFiles WMI API) are user sensitive, and they only work when I run my service as the user whose data I want to query. I don't want users to have to enter their usernames and passwords when installing the service, so I'd like to just run the service as Local System or something, and impersonate