How to fix erlang application restarting with upstart? - erlang

I have an erlang application (OTP 21) that runs as an upstart service. When I try to restart application with sudo initctl restart my_service I got an error:
Protocol 'inet_tcp': the name my_service#localhost seems to be in use by another Erlang node
and application don't started again.
Based on dates in logs I decided that upstart try to start application a few milliseconds before it actually stopped. How can I fix this?

Related

Docker for Windows auto startup

I've installed Dockers for Windows. Every time I start my computer it does not start up properly. I am always faced with this dialog.
I've tried starting and stopping the service, but it never seems to startup properly upon windows startup.

How to run sidekiq in background

I am using this command
bundle exec sidekiq -d
to run sidekiq server on the background. getting this error message
ERROR: Daemonization mode was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services.
sidekiq run but not in the background. After closing the console sidekiq automatically close.
You may also think about using process manager like overmind which will help you manage multiple processes (for instance server and sidekiq)
https://github.com/DarthSim/overmind
There are other tools around the web, this is my personal choice.
You need to open another terminal tab, in ubuntu ctrl + shift + T and run command
bundle exec sidekiq start
It is removed from the latest versions of Sidekiq to promote users to learn the newer, better ways. Here is the link to the discussion on the same.
The discussion suggested using a process supervisor like systemd, upstart, foreman, etc. to manage Sidekiq.
So you need to write your own service file to start, stop sidekiq. For the reference, here is the link to example service of sidekiq.
https://github.com/mperham/sidekiq/blob/master/examples/systemd/sidekiq.service
You didn't mention the operating system so I'll just go with ubuntu production VM. You're going to want to setup sidekiq with something like systemd or upstart. Sidekiq has some example configurations to get you started https://github.com/mperham/sidekiq/tree/master/examples.
I haven't done this on a mac before, but a quick google and found this Start sidekiq automatically on OSX.

Jenkins_"Please wait while Jenkins is restarting" , quite a persistent one

I am getting the "Please wait while Jenkins is restarting" issue , I have restarted the Jenkins service but it still isn't working , I tried to install a plugin yesterday and since then it's showing me that message.
Any help would be much appreciated.
The simplest thing which will work almost every time is:
Login to the (windows) server where Jenkins is hosted.
Open CMD Prompt as administrator.
Go to path where jenkins.exe file is placed.
Enter command: jenkins.exe stop and then jenkins.exe start
For Linux server, kill the process and restart again.

Jenkins service starts then stops on Windows 7

I downloaded the native windows Jenkins package and installed it. On installation, it starts as a service in and shows in Task Manager, and also on going to the url localhost:8080. But then it stops. Here is what I get in my jenkins.out.log:
Running from: C:\Program Files (x86)\Jenkins\jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
Jenkins home directory: C:\Program Files (x86)\Jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Any ideas what could be causing this? I've checked throuh netstat that no other process is using the port 8080.
I found that the java.exe process was hung and keeping Jenkins from starting. I killed the java process and then jenkins service started up just fine.
Use process explorer.
It's possible to start jenkins via the command line using java -jar jenkins.war, however, because the process is started via the command line it will also end when that command window is closed.
A better way would be to start the service via jenkins.exe but you would have to remind doing that at every startup.
Ultimately we have settled with a batch script with the following content:
cd "C:\Program Files (x86)\Jenkins"
start javaw -jar jenkins.war >> outputFile.txt
adding start before calling javaw makes sure that the command window is not attached to the process started, making it possible to safely close down the command line.
Using >> outputFile.txt writes the command window feedback in a text file, making debugging a whole lot easier when Jenkins ever breaks down!
Save it in a batch script, schedule it with windows Task Scheduler to run at startup et voilà: properly set up Jenkins service.
Only make sure it doesn't stop at log-off.
I switched back to version 1.535 and now it works.
After my win vm system rebooted, the jenkins 1.625.2 service would just keep stopping.
It solved it by:
Kill java processes. Found some old java running dll's.
Uninstall old version of jdk1.6 that was there.
Cleaning java temp. files dir.
Then I was able to restart the service w/o problem.
if java.exe not visible in process
1.netstat -a -o -n find out the PID of your port
2.tasklist /FI “PID eq PID″
3.taskkill /F /PID 2600 kill the process

Webrick will not stop or restart

I was running Linux Mint 13 prior to now, and just switched to Fedora 17. Since I have made the switch, I can no longer stop Webrick. I use Jetbrains Rubymine, and starting the server works fine, but as soon as I hit stop, or restart, it somehow detatches from the processes and I cannot use that port again until I reboot my computer. My first thoughts were that it was a problem with Rubymine, but when I start the server in a console, it does the exact same thing. I hit ctrl-c to stop it (and it appears to do so), but as soon as I go to start the server again on that port, it fails because of duplicate address in use.
I have this error on Mint (opposite to you, as I see) - Ubuntu machine always exits fine by CTRL+C. Solution without restarting your machine: kill Webrick process. Search for a PID of detached server process via ps aux | grep rails command and then kill it via kill -9 <PID>
In one line you can run this in your project dir:
kill -9 `cat tmp/pids/server.pid`
(You can also set this command as an alias in your .bash_profile, to use more easily)
Or is there no Webrick process to kill, whatsoever?

Resources