I have created a service using sc.exe for tomcat6.exe. The command is:
sc.exe create "Tomcat Service" binPath= "D:\tomcat\bin\tomcat.exe
Creating the service was successful, but I get the following error while starting the service.
Error 1053: the service did not respond to the start or control request in a timely fashion
Both starting from cmd using sc.exe start "Tomcat Server" and services.msc result in the same error.
Can anyone help me please?
Thank you all in advance.
While Tomcat.exe is a true windows service, installing it with SC is not good enough. Install Tomcat 6 as a service using the "service.bat" file or by composing your own command line options for tomcat6.exe (including the //IS// parameter).
Related
Please help after installing Thingsboard successfully on windows I'm getting this error while try start the services.
The ThingsBoard Server Application service is starting.
The ThingsBoard Server Application service could not be started.
A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.
In some cases, you must set the full path to the java file.to do that:
1- open the thingsboard.xml file in the base directory.
2- search for this line <executable>java</executable>
3- change the above line with <executable>C:\Program Files\Java\jdk1.8.0_121\bin\java</executable>
4- net start thingsboard
output
The ThingsBoard Server Application service is starting.
The ThingsBoard Server Application service was started successfully.
This is a known bug (see here).
If AYR1112013's solution will not work, you can temporarly fix the issue by removing the flag "-XX:+UseCondCardMark" in your thingsboard.xml.
After that start the service as usual with "net start thingsboard".
After I build my application on Jenkins,
the output message says my build is success, however I get this error message in the end, and my website can't work...
D:\Jenkins\jobs\1.job\workspace>SC \\123.45.12.133 START w3svc
[SC] StartService FAILED 1056:
An instance of the service is already running.
Any suggestion?
It says the w3svc(World Wide Web publishing service) can not start by Jenkins.
So you should start it manually by following steps:
Open your services in administrative tool
Right click w3svc(World Wide Web publishing service) and re-start it.
Or use command line and input sc start w3svc
I want to restart Windows service using command prompt in [Icons] section using Inno Setup. Please help me to solve the problem.
You can use sc start [service] to start a service and sc stop [service] to stop it. With some services net start [service] is doing the same.
But if you want to use it in the same batch, be aware that sc stop won't wait for the service to be stopped. In this case you have to use net stop [service] followed by net start [service]. This will be executed synchronously.
You could create a .bat-file with following content:
net stop "my service name"
net start "my service name"
net.exe stop "servicename" && net.exe start "servicename"
To restart a running service:
net stop "service name" && net start "service name"
However, if you don't know if the service is running in the first place and want to restart or start it, use this:
net stop "service name" & net start "service name"
This works if the service is already running or not.
For reference, here is the documentation on conditional processing symbols.
This is my code, to start/stop a Windows service using SC command. If the service fails to start/stop, it will print a log info. You can try it by Inno Setup.
{ start a service }
Exec(ExpandConstant('{cmd}'), '/C sc start ServiceName', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
Log('sc start ServiceName:'+SysErrorMessage(ResultCode));
{ stop a service }
Exec(ExpandConstant('{cmd}'), '/C sc stop ServiceName', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
Log('sc stop ServiceName:'+SysErrorMessage(ResultCode));
You can start and stop and query services using the SC command. As for innosetup i'm not sure.
PowerShell features a Restart-Service cmdlet, which either starts or restarts the service as appropriate.
The Restart-Service cmdlet sends a stop message and then a start message to the Windows Service Controller for a specified service. If a service was already stopped, it is started without notifying you of an error.
You can specify the services by their service names or display names, or you can use the InputObject parameter to pass an object that represents each service that you want to restart.
It is a little more foolproof than running two separate commands.
The easiest way to use it just pass either the service name or the display name directly:
Restart-Service 'Service Name'
It can be used directly from the standard cmd prompt with a command like:
powershell -command "Restart-Service 'Service Name'"
I have followed this link to run Selenium Server as a windows service: http://www.claytonstechnobabble.com/2011/08/run-any-application-as-windows-service.html
The service gets installed successfully but when I try to run it it gives error:
"The SeleniumRC service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs."
can you guys help me on that asap? what am I missing?
This is the selenium server file that I am trying to run: "selenium-server-standalone-2.5.0.jar"
Ali, you might try capturing the output from the service. Since the Java app is designed to be run in console mode, there is likely to be some useful explanation if you can capture std out and std err. Running the service with a wrapper like Java Service Launcher will provide that functionality to log the error information: http://jslwin.sourceforge.net/
Create a bat file containing
//cd Location of file
java -jar selenium-server-standalone-2.5.0.jar
then use this bat file to execute in service.
I have designed a simple windows service in .NET 2.0.
I am trying to deploy it on my local machine. I have switched to design view, and setup ServiceInstaller and ServiceProcessInstaller objects. There is a Project Installer. I have also wrapped the Windows Service into a .NET setup project and install it, leaving an .exe in the specified directory.
I have fired up cmd and entered the path to installutil. This works fine, but then I typeinstallutil and the full path to the service, in Visual Studio command prompt, and this does not work (I've also tried installutil /i and all sorts of things out of desperation). The permissions are local system (extensive).
Any ideas what I am doing wrong? For those here who have installed Windows Services, what was your methodology to install the service?
Thanks
We actually create an installer built into our application. It's a console app that has a command line to install/uninstall the server as well as run as a service or in console mode.
See this article on a Self Installing Service for some details. I like this method as it provides flexibility.
DESCRIPTION:
SC is a command line program used for communicating with the
NT Service Controller and services.
USAGE:
sc [command] [service name] ...
The option has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc [command]"
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistant).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.
The following commands don't require a service name:
sc
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService
Here's another reference specific to .NET services.
http://bytes.com/forum/thread739857.html
I'm calling installutil in my setup package and it works for me just fine.
That'd be great if you posted an error message that you're getting when running installutil.