我有一个处理程序试图重新启动 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: [host01]: 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 上重新启动服务没有问题:
vagrant@vagrant-ubuntu-trusty-64:~$ sudo service php5-fpm restart
php5-fpm stop/waiting
php5-fpm start/running, process 18984
我已经阅读了以下内容:
Nginx cannot restart via Ansible
而且我知道 php5-fpm 和 ubuntu 14.04 的错误 ansible 1.9.1 错误,所以我已经将我的 ansible 更新为
$ ansible --version
ansible 2.0.0.2
config file = /Users/myUser/vagrant/test/ansible.cfg
configured module search path = Default w/o overrides
最佳答案
我遇到了完全相同的问题,这是我的解决方法:
handlers:
- name: restart php5fpm
command: service php5-fpm restart
希望对你有帮助
关于ubuntu - ansible 无法重新启动 php5-fpm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38421765/