Install Quartz.NET as a windows service on Windows 10 - ERROR - quartz.net

I'm trying to install Quartz.NET as a windows service on Windows 10.
The version of Quartz.NET is v2.6.2 and i have used this tutorial to do it. In other OS's like Windows 7 and Windows Server 2012 i have installed this version successfully.
When i run the command to instal as a service:
C:\Program Files (x86)\Quartz.NET>Quartz.Server.exe install
I have the following successful message:
Configuration Result:
[Success] Name QuartzServer
[Success] DisplayName Quartz Server
[Success] Description Quartz Job Scheduling Server
[Success] ServiceName QuartzServer
Topshelf v3.1.135.0, .NET Framework v4.0.30319.42000
Running a transacted installation.
Beginning the Install phase of the installation.
Installing Quartz Server service
Installing service QuartzServer...
Service QuartzServer has been successfully installed.
Creating EventLog source QuartzServer in log Application...
The Install phase completed successfully, and the Commit phase is beginning.
The Commit phase completed successfully.
The transacted install has completed.
But when i run the following command (Quartz.Server.exe -i) to see whether my installation has been successful installed, i have the following message:
C:\Program Files (x86)\Quartz.NET>Quartz.Server.exe -i
Topshelf.HostFactory Error: 0 : An exception occurred creating the host, Topshelf.HostConfigurationException: The service was not properly configured:
[Failure] Command Line An unknown command-line option was found: SWITCH: i (True)
[Success] Name QuartzServer
[Success] DisplayName Quartz Server
[Success] Description Quartz Job Scheduling Server
[Success] ServiceName QuartzServer
at Topshelf.Configurators.ValidateConfigurationResult.CompileResults(IEnumerable1 results)
at Topshelf.HostFactory.New(Action1 configureCallback)
Topshelf.HostFactory Error: 0 : The service terminated abnormally, Topshelf.HostConfigurationException: The service was not properly configured:
[Failure] Command Line An unknown command-line option was found: SWITCH: i (True)
[Success] Name QuartzServer
[Success] DisplayName Quartz Server
[Success] Description Quartz Job Scheduling Server
[Success] ServiceName QuartzServer
at Topshelf.Configurators.ValidateConfigurationResult.CompileResults(IEnumerable1 results)
at Topshelf.HostFactory.New(Action1 configureCallback)
at Topshelf.HostFactory.Run(Action`1 configureCallback)
All of the commands have been run in Administration mode.
Is there any configuration that i have missed on Windows 10?
EDIT
I don't have access to start and stop buttons in Quartz Server windows service, they are disabled.
If i run Quartz.Server.exe on command prompt its executes the scheduler perfectly. But when i run Quartz.Server.exe -i it gives me the error that i have mention on my first post. And i still don't have access to start and stop buttons
EDIT 2
I have installed the last version of Quartz and the problem is the same comparing to previous version, except the unknown command-line option was found (see error message).
Quartz v2.6.2
Topshelf v3.1.4.357038
Topshelf.HostFactory Error: 0 : An exception occurred creating the host, Topshelf.HostConfigurationException: The service was not properly configured:
[Failure] Command Line An unknown command-line option was found: SWITCH: i (True)
Quartz V3.0.7
Topshelf v4.1.0.172
Topshelf.HostFactory Error: 0 : An exception occurred creating the host, Topshelf.HostConfigurationException: The service was not properly configured:
[Failure] Command Line An unknown command-line option was found: DEFINE: i =
Maybe this could be some configuration that is affecting Topshelf.
EDIT 3
I have been confirmed that this error is also being fired in Windows Server 2012 R2 Standard production server, when running the command Quartz.Server.exe -i. The difference is that in production environment we have start/stop buttons enabled, but in windows 10 machine i don't have start/stop buttons enabled.

Related

Installed Jenkins on Windows 10 and getting PID file does not exist when I start the Jenkins service

I installed Jenkins version 2.332.2 on Windows 10. I tried to start the Jenkins service, but it says it failed to start. In the Jenkins.wrapper.log I see the following error: "The requested PID file 'C:\tools\Jenkins\jenkins.pid' does not exist. The runaway process won't be checked"

Install Jenkins as Windows Service when I already have existing Jenkins install?

We have an existing Jenkins install that I run from the command line. I want to start using it as a Windows Service instead, so that it launches when the machine restarts, without requiring someone to log in.
I have read about how to do it, but I am worried that it might break our existing setup, the jobs and other scripts that rely on the current location. Apparently when you go to Install Jenkins as a Windows Service, it asks you for a location for JENKINS_HOME.
Can I just give it the existing location? Will it just work or is there a danger of it wiping out what's there? And if I want to be safe and back up everything just in case, can I just make a copy of the existing .jenkins folder and then copy it back if something goes wrong? Or are there other files somewhere that I need to back up?
My question is basically the same as this one, which never got an answer:
Installing existing Jenkins as a Windows Service
Thanks
You should just be able to do this directly from the UI. (It used to be documented on the Jenkins wiki, but that's presently down.)
Fire up your command line Jenkins java -jar -jenkins.war, go to "Manage Jenkins" (${JENKINS_URL}/manage). You should see an icon "Install as Windows Service".
Click on it and you arrive at ${JENKINS_URL}/install. Point it at your existing install and click "Install". You will get a prompt to restart as a service and then it restarts.
You're done. You should see in your logs the system restarting messages:
2021-09-10 00:25:44.077+0000 [id=96] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins
2021-09-10 00:25:44.080+0000 [id=96] INFO jenkins.model.Jenkins$18#onAttained: Started termination
2021-09-10 00:25:44.099+0000 [id=96] INFO jenkins.model.Jenkins$18#onAttained: Completed termination
2021-09-10 00:25:44.100+0000 [id=96] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
2021-09-10 00:25:44.115+0000 [id=96] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
2021-09-10 00:25:44.115+0000 [id=96] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
2021-09-10 00:25:44.127+0000 [id=96] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
2021-09-10 00:25:44.127+0000 [id=96] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
[.jenkins] $ C:\Users\ \.jenkins\jenkins.exe start
2021-09-09 17:25:45,153 INFO - Starting the service with id 'jenkins'
You should also now see the jenkins service running in Windows Services:
You can manage it via the Services UI, the command line via SC, or the jenkins.exe binary:
NOTE: The same security caveats regarding running as LocalSystem apply regardless of if using this mechanism or the MSI install. Recommend changing to run as a local user; needs LogonAsService permission (Using the LocalSystem Account as a Service Logon Account, Why running a service as Local System is bad on windows). Local Security Policy > Local Policies > User Rights Management > Log on as a service.
C:\>sc query jenkins
SERVICE_NAME: jenkins
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\> sc stop jenkins
SERVICE_NAME: jenkins
TYPE : 10 WIN32_OWN_PROCESS
STATE : 3 STOP_PENDING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\> sc delete jenkins
[SC] DeleteService SUCCESS
C:\>
C:\Users\ \.jenkins> jenkins.exe /?
A wrapper binary that can be used to host executables as Windows services
Usage: winsw [/redirect file] <command> [<args>]
Missing arguments trigger the service mode
Available commands:
install install the service to Windows Service Controller
uninstall uninstall the service
start start the service (must be installed before)
stop stop the service
stopwait stop the service and wait until it's actually stopped
restart restart the service
restart! self-restart (can be called from child processes)
status check the current status of the service
test check if the service can be started and then stopped
testwait starts the service and waits until a key is pressed then stops the service
version print the version info
help print the help info (aliases: -h,--help,-?,/?)
Extra options:
/redirect redirect the wrapper's STDOUT and STDERR to the specified file
WinSW 2.9.0.0
More info: https://github.com/kohsuke/winsw
Bug tracker: https://github.com/kohsuke/winsw/issues
Images captured from 2.303.1 on Win 10 Enterprise; YMMV.

unable to deploy .net project using TFS IIS app deployment task

I am trying to deploy my project to IIS using TFS Winrm:IIS web app deployment task. I am new to this.
I am getting the following error'
"Deployment failed on machine xxx with following message : System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server xxx failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". "
I was able deploy the project to the same remote server using TFS Winrm: windows machine file copy task which is the prior step for web app deployment to IIS. Winrm service is running and when it type the "winrm quickconfig i am getting "winrm is already been configured".
What am i missing here ? please suggest. Thanks in advance.
The Winrm:IIS task is actually MSDeploy from Machine A to Machine B so for this to work you need to install MSDeploy on Machine B. You should then be ok to deploy from Machine A. Check this article out for more information and to see if you have all the pre-requisite. Also these articles have a bit more info.
https://learn.microsoft.com/en-us/azure/devops/pipelines/apps/cd/deploy-webdeploy-iis-winrm?view=azure-devops
https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.iiswebapp
The issue was resolved when i enable remote powershell remoting my remote machine using the command Enable-PSRemoting –force

START w3svc [SC] StartService FAILED 1056: An instance of the service is already running

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

Unable to run Selenium RC server as windows service

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.

Resources