Question

I am working on beanstalkd on Ubuntu (Very new for me), I want to know which is good way to start beanstalkd service on ubuntu boot.

In short, I would like to execute,

beanstalkd -b /path/to/binlog/directory -l 127.0.0.1 -p 11300

  1. Using /etc/default/beanstalkd . I have added following code and reboot system (Not working)

    BEANSTALKD_LISTEN_ADDR=127.0.0.1
    BEANSTALKD_LISTEN_PORT=11300
    BEANSTALKD_BINLOG_DIR=/var/www
    DAEMON_OPTS="-l $BEANSTALKD_LISTEN_ADDR -p $BEANSTALKD_LISTEN_PORT -b $BEANSTALKD_BINGLOG_DIR"
    START=yes
    
  2. sudo nano /etc/init/beanstalkd.conf and pasting and reboot system (Not working)

     description "simple, fast work queue"
     start on filesystem stop on runlevel [!2345]
     respawn respawn limit 5 2
     exec su nobody -c 'exec /usr/local/bin/beanstalkd'
    
  3. By editing rc.local file under /etc/ folder. Paste my command to execute before exit 0 (Working fine for me)

Was it helpful?

Solution

There is a sample Upstart script in the Beanstalkd repo at https://github.com/kr/beanstalkd/tree/master/adm/upstart which differs to your own only by the start/stop and respawn lines being seperated.

The configuration of the Binlog directory, and IP address can be added to the beanstalkd.conf file easily enough.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top