Can’t start mongodb service
Check mongodb logs. In my case mongodb could not find directory from mongod.cfg
Check mongodb logs. In my case mongodb could not find directory from mongod.cfg
I’ve had this issue too. As mentioned by genki you are probably logging into the \Windows\System32 directory. Maybe check for the log file you are expecting there first. When writing services I’ve often put a line like this in the beginning to get the current directory to behave like a normal application Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
First approach with Windows Service is not easy.. A long time ago, I wrote a C# service. This is the logic of the Service class (tested, works fine): namespace MyServiceApp { public class MyService : ServiceBase { private System.Timers.Timer timer; protected override void OnStart(string[] args) { this.timer = new System.Timers.Timer(30000D); // 30000 milliseconds = 30 … Read more
When we use /savecred switch we should not give the credentials in the same line. The correct command should be: net use P: \\server\folder /savecred /persistent:yes It will ask for username and password.
I know I am quite late to answer this but I faced a similar issue , i.e., the error: “The service cannot accept control messages at this time.” and would like to add this as a reference for others. You can try killing this service using powershell (run powershell as administrator): #Get the PID of … Read more
As of 0.90.5+, support for running ElasticSearch as a Windows Service is officially included in the Windows distribution. https://www.elastic.co/blog/0-90-5-released/ From the bin folder: > service.bat Usage: service.bat install|remove|start|stop|manager [SERVICE_ID] > service install Installing service : ‘elasticsearch-service-x64’ Using JAVA_HOME (64-bit): c:jvmjdk1.7 The service ‘elasticsearch-service-x64’ has been installed. > service start The service ‘elasticsearch-service-x64’ has been started … Read more
In my case, target Framework of Assembly Project and the target Framework of the project where i want to use this assembly are different. Target framework of assembly project was 4.5 and target framework of my project was 4.0. When I have change the target framework of my project to the target framework of assembly … Read more
Totally possible. The trick is to edit the .dpr to create main form when you want to run as an application and the service form when you want to run as a service. Like this: if SvComFindCommand(‘config’) then begin //When run with the /config switch, display the configuration dialog. Forms.Application.Initialize; Forms.Application.CreateForm(TfrmConfig, frmConfig); Forms.Application.Run; end else … Read more
The correct name of the account is NT AUTHORITY\NETWORK SERVICE.
Here’s my take on the issue: using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace EnumerateRDUsers { class Program { [DllImport(“wtsapi32.dll”)] static extern IntPtr WTSOpenServer([MarshalAs(UnmanagedType.LPStr)] string pServerName); [DllImport(“wtsapi32.dll”)] static extern void WTSCloseServer(IntPtr hServer); [DllImport(“wtsapi32.dll”)] static extern Int32 WTSEnumerateSessions( IntPtr hServer, [MarshalAs(UnmanagedType.U4)] Int32 Reserved, [MarshalAs(UnmanagedType.U4)] Int32 Version, ref IntPtr ppSessionInfo, [MarshalAs(UnmanagedType.U4)] ref Int32 pCount); [DllImport(“wtsapi32.dll”)] static extern void … Read more