2016-07-17 36 views
0

我有一個處理程序嘗試重新啓動PHP5-FPM:ansible不能重啓PHP5-FPM

handlers: 
    - name: restart nginx 
     service: name=nginx state=restarted 
    - name: restart php5fpm 
     service: name=php5-fpm state=restarted 
    - name: restart mysql 
     service: name=mysql state=restarted 

和通知調用處理:

- name: copy php.ini to php config folder 
    template: src=php.ini.j2 dest=/etc/php5/fpm/php.ini owner=root group=root mode=0644 
    changed_when: true 
    notify: 
    restart php5fpm 

這種失敗:

RUNNING HANDLER [restart php5fpm] ********************************************** 
fatal: [sexada01]: FAILED! => {"changed": false, "failed": true, "msg": "stop: Rejected send message, 1 matched rules; type=\"method_call\", sender=\":1.313\" (uid=1002 pid=18082 comm=\"stop php5-fpm \")  interface=\"com.ubuntu.Upstart0_6.Job\" member=\"Stop\" error name=\"(unset)\" requested_reply=\"0\" destination=\"com.ubuntu.Upstart\" (uid=0 pid=1 comm=\"/sbin/init \")\nstart: Rejected send message, 1 matched rules; type=\"method_call\", sender=\":1.314\" (uid=1002 pid=18086 comm=\"start php5-fpm \") interface=\"com.ubuntu.Upstart0_6.Job\" member=\"Start\" error name=\"(unset)\" requested_reply=\"0\" destination=\"com.ubuntu.Upstart\" (uid=0 pid=1 comm=\"/sbin/init \")\n"} 

雖然VM上的服務重啓沒有問題:

[email protected]:~$ sudo service php5-fpm restart 
php5-fpm stop/waiting 
php5-fpm start/running, process 18984 

我已經閱讀了以下內容: Nginx cannot restart via Ansible

我知道的錯誤ansible 1.9.1蟲絲毫PHP5-FPM和Ubuntu 14.04,所以我已經更新了我的ansible到

$ ansible --version 
ansible 2.0.0.2 
    config file = /Users/myUser/vagrant/test/ansible.cfg 
    configured module search path = Default w/o overrides 

回答

2

我有完全相同的問題,這裏是我周圍的工作是:

handlers: 
- name: restart php5fpm 
    command: service php5-fpm restart 

希望這將有助於你

+0

工程就像一個魅力,謝謝你先生。 – Worp