I have an service where we use TopShelf. Now I would like to install the service with Octopusdeploy but I can't get it to work. The tentacle seems to hang when I'm trying to start the service. The Deploy.ps1 looks like:
$cmd = "$OctopusPackageDirectoryPath" + "\NameOfExe.exe"
& $cmd "stop"
& $cmd "uninstall"
& $cmd "install"
& $cmd "start"
It works just fine to execut that powershell script in powershell, but the tentacle gets stuck on the last step. I can see in the log that the service is stopped, uninstalled and installed but it hangs on start.
Any recommendations?
I found the answer to my problem. I am trying to set up a service running quartz.net and it seems that it seems like setting quartz that's causing the problem based on some weird security settings.
Related
I've recently updated git bash to 2.35.1. I do Minecraft plugin/server development so am often using git bash to start and manage test servers in windows. Unfortunately I do not know what version I was on before.
Now when I started a server using java -Xms4G -Xmx4G -jar server.jar it boots, but I can't type anything into the console. I am completely locked out. Using CTRL+C will shutdown the server but it says "do you want to terminate the batch job" and hangs. I have to force quit the java process.
Before, I could type game console commands in without issue.
I've tried running git bash as administrator, no change. PowerShell doesn't work at all, it won't even show the output of the console after starting the jar.
When I stop the server from in-game, I get this error after it fully stops:
$ stop
bash: stop: command not found
I'm using Windows containers and the microsoft/nanoserver as my base. I'm trying to start up a Tomcat server during the build, but when I do so the build hangs and all I can is cancel it. Unfortunately I have to start the server so it will deploy a war file so that I can then stop the server and alter its configuration. I know I can just run the image, make my changes, and then commit but this seems like cheating. The only thing I can think of is that the startup / catalina script is writing to stdout, but I've tried redirecting to null and it still hangs. Any ideas out there for me to try?
Dockerfile excerpt:
RUN powershell start-process -FilePath .\startup.bat -ArgumentList "/c" -NoNewWindow -RedirectStandardOutput Out-Null
It looks like you can't have a java process running on the image during the build; I was able to fix this by using Start-Sleep to wait for about a minute and then kill any java process running on the machine. The build proceeded after that.
My octopus installs Windows Service in a machine, but sometimes it can't stop the service so it doesn't deploy.
If I manually go to the machine and try to stop the service, I can't. But if I first go to Task Manager and kill the process of the service, then I can stop the service.
Does Octopus already have a built-in feature to do this for me? Or should I create a .bat to execute it before reinstalling windows service?
Same to Ryan's process, we use the command in this format to kill process that would not gracefully shutdown
taskkill /im Processname /f
Just a note, this takes Process Name not Service Name, and all services share the same process name will be killed.
You could try using a custom powershell pre-deployment script (enable the custom deployment scripts feature for your deployment step) or by placing this in a predeploy.ps1 file in your nuget package.
kill -processname serviceName
If you import the step template Stop Service With Kill you can add this as a deployment step.
The documentation here provides a step by step way to do this
I'm attempting to get my Jboss Server running as a windows service using the JbossService.exe, and I had it working until I uninstalled it (with ./JbossService -uninstall JbossService), and now, while it will install and the service will appear in the windows service list, attempting to start it will only yield the error message:
"The JBossService on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."
If it helps, the command I'm using to install it is:
./JBossService.exe -install JBossService "$java_home\jre\bin\server\jvm.dll"
-Xmx128m -Xrs -Djava.class.path="$java_home\lib\tools.jar;$jboss_home\bin\run.jar"
-Duser.timezone="Australia/Sydney"
-start "org.jboss.Main" -stop "org.jboss.Main"
-method systemExit -out "$jboss_home\server\default\log\stdout.log"
-err "$jboss_home\server\default\log\stderr.log"
-current "$jboss_home\bin"
Any ideas would be appreciated. If more information is required just let me know.
Are you using Cygwin? If not, this could be due to the fact that environment variables are referenced using %%, not $, on Windows. You might try the following instead:
JBossService.exe -install JBossService "%java_home%\jre\bin\server\jvm.dll"
-Xmx128m -Xrs -Djava.class.path="%java_home%\lib\tools.jar;%jboss_home%\bin\run.jar"
-Duser.timezone="Australia/Sydney"
-start "org.jboss.Main" -stop "org.jboss.Main"
-method systemExit -out "%jboss_home%\server\default\log\stdout.log"
-err "%jboss_home%\server\default\log\stderr.log"
-current "%jboss_home%\bin"
Even if you are using Cygwin, the $ notation still might not work if, for example, these parameters are being stored in the Registry and then read later from the OS (which does not understand Cygwin notation).
While this does have a valid answer, one reason this happened to me recently is because the user the JBoss Windows Service was running as had certain active directory permissions revoked from the server (in this case, administrative-like permissions); it could no longer access certain directories it required in order to process (the Java bin folder, for example).
Once the user the service ran as was added back to the appropriate Windows User Groups, the JBoss Windows Service started with no issues.
In my case, JAVA_HOME was not set. Once I did that, Automatically windows Services started.
:)
I downloaded Hudson, and am trying to install it as a service. I followed the steps from this page, but when I try to start the service, it always fails. I'm not really getting any defined error codes either. If I try to run the service from the command line (using net start) I get the following (unhelpful) message:
The hudson service could not be started.
The service did not report an error.
The install process seemed to work fine, as the hudson service is installed, and all the files are in the new directory, but the service won't start. Has anyone else run into this problem?
As documented on that page, they have a note of...
If a restart fails for some reason, check the output from Hudson, which is stored in the installation directory that you specified.
Is there anything to denote further errors?