5

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)

4

1 回答 1

3

在https://github.com/kr/beanstalkd/tree/master/adm/upstart的 Beanstalkd 存储库中有一个示例 Upstart 脚本, 它与您自己的不同之处仅在于 start/stop 和 respawn 行是分开的。

Binlog 目录的配置和 IP 地址可以很容易地添加到 beanstalkd.conf 文件中。

于 2013-04-18T12:48:59.213 回答