我有一个处理程序试图重新启动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
而且我知道bug ansible 1.9.1的bug,它的php5-fpm和ubuntu14.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发布于 2016-07-17 15:24:47
我也遇到了同样的问题,下面是我的工作:
handlers:
- name: restart php5fpm
command: service php5-fpm restart希望它能帮到你
https://stackoverflow.com/questions/38421765
复制相似问题