1

I am trying to run Catalyst on CentOS 7 using start-stop-daemon. Here is the start-stop-daemon command that I run:

start-stop-daemon --start --pidfile /var/run/myapp.pid -d "/home/user/myapp" --exec /opt/perlbrew/perls/perl-5.22.0/bin/perl --startas "/home/user/myapp/script/myapp_fastcgi.pl" --chuid root --make-pid -- "-l :8100 -n 6"

Then I get this error:

Cannot resolve host name   -- exiting!

It displays this error after loading the chained actions and printing them to the screen, and after displaying the final message:

[info] myapp powered by Catalyst 5.90112

In /etc/hosts I've tried commenting out any hostnames I thought might be causing an issue:

127.0.0.1 myapp.com myapp.com 
#127.0.0.1 localhost.localdomain localhost
#127.0.0.1 localhost4.localdomain4 localhost4

# The following lines are desirable for IPv6 capable hosts
#::1 myapp.com myapp.com
#::1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6

What's strange is that if I don't use start-stop-daemon and I just start the server from the command-line, the server starts fine.

srchulo
  • 4,843
  • 4
  • 38
  • 68

1 Answers1

0

Most likely it can't resolve your hostname.

Check what your hostname command returns and make sure that same host name is present in your /etc/hosts. And don't assign it to loopback, use a real IP.

You can also trace what exactly it's trying to resolve by using this method

https://serverfault.com/questions/666482/how-to-find-out-pid-of-the-process-sending-packets-generating-network-traffic

Or might be even more simple to do tcpdump -s 0 port 53

Community
  • 1
  • 1
Dmitry Zayats
  • 476
  • 2
  • 6