I have Beanstalkd installed via apt-get on deb8, version 1.10.
My /etc/default/beanstalkd is:
BEANSTALKD_LISTEN_ADDR=0.0.0.0
BEANSTALKD_LISTEN_PORT=11300
BEANSTALKD_EXTRA="-b /var/lib/beanstalkd -f 2000"
START=yes
But when I start and check status it shows me:
● beanstalkd.service - Simple, fast work queue
Loaded: loaded (/lib/systemd/system/beanstalkd.service; enabled)
Active: active (running) since Fri 2016-03-18 10:10:51 CET; 59s ago
Docs: man:beanstalkd(1)
Main PID: 16274 (beanstalkd)
CGroup: /system.slice/beanstalkd.service
└─16274 /usr/bin/beanstalkd -l 0.0.0.0 -p 11300 -b /var/lib/beanstalkd -f 2000
Mar 18 10:10:51 asdf beanstalkd[16274]: /usr/bin/beanstalkd: inherited listen fd; ignoring option: -l 0.0.0.0
Mar 18 10:10:51 asdf beanstalkd[16274]: /usr/bin/beanstalkd: inherited listen fd; ignoring option: -p 11300
And when checking netsat I see it is listening to 127.0.0.1 instead of 0.0.0.0
$ netstat -nat | grep LISTEN
tcp 0 0 127.0.0.1:11300 0.0.0.0:* LISTEN
This is programming issues tracker. Support is here: https://groups.google.com/forum/#!forum/beanstalk-talk
Hi @tuuling! This is happening because beanstalkd was started by systemd. When systemd starts a network service, systemd itself actually opens the listen socket and provides it to the new process. That's why beanstalkd is ignoring options -l and -p, because systemd already opened the socket.
Based on the status output you pasted above, I'm guessing you might find the relevant configuration in /lib/systemd/system/beanstalkd.service.
I hope this helps!
Also, for the future, @sbrawner is right. You're more likely to get quick feedback if you ask questions on the mailing list rather than here. There is a larger community of people there.
Thanks a lot. Was not sure if it's conf or code error.
Removing the /lib/systemd/system/beanstalkd.socket file solved this issue for me.
I did the following to get this going on EC2 with Ubuntu 16.04
sudo vim /etc/default/beanstalkd # change IP to 0.0.0.0
sudo systemctl daemon-reload # reload daemon! not sudo service beanstalkd restart!
netstat -nat | grep LISTEN # see if `0.0.0.0:11300` is in the list
@james2doyle - Yeah, I was trying to get this working in an AWS EC2 CloudFormation init configuration, and since cfn-init currently supports sysvinit only, I had to add a couple commands that do a systemctl daemon-reload _and_ systemctl restart beanstalkd.
@geerlingguy Ah interesting. I am about to do another project with this so I will see if the instructions are still the same or if I need to update them
@james2doyle yeah, and note that this was with Ubuntu 16.04 (one of Amazon's AMIs). I know I had different results when I was testing on CentOS 7 earlier.
To anyone who stumbles upon the same problem.
The problem is that if you install beanstalkd from a debian package it comes with both systemd .service and .socket. (you can read about them here https://unix.stackexchange.com/questions/159462/what-is-systemds-target-service-and-socket)
So when beanstalkd is started by .socket it will be 127.0.0.1 no matter how you configure the .service.
You can disable the .socket on startup by sudo systemctl disable beanstalkd.socket OR as suggested above remove the /lib/systemd/system/beanstalkd.socket file.
Changing /etc/default/beanstalkd and/or restarting beanstalkd might only work until your machine restarts.
If you are not sure if you need the .socket or not, you most likely don't need it.
Most helpful comment
To anyone who stumbles upon the same problem.
The problem is that if you install beanstalkd from a debian package it comes with both systemd .service and .socket. (you can read about them here https://unix.stackexchange.com/questions/159462/what-is-systemds-target-service-and-socket)
So when beanstalkd is started by .socket it will be 127.0.0.1 no matter how you configure the .service.
You can disable the .socket on startup by
sudo systemctl disable beanstalkd.socketOR as suggested above remove the/lib/systemd/system/beanstalkd.socketfile.Changing
/etc/default/beanstalkdand/or restarting beanstalkd might only work until your machine restarts.If you are not sure if you need the .socket or not, you most likely don't need it.