~bloodearnest/charms/precise/pgbouncer/fix-port-restart

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Simon Davy
  • Date: 2015-01-23 15:08:13 UTC
  • Revision ID: bloodearnest@gmail.com-20150123150813-jgbmp9tcm7z2n9uf
hard restart on addr/port change, to force new port

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
                                master, standbys)
88
88
    open_ports(config)
89
89
    if host.service_running(SERVICE_NAME):
90
 
        host.service_reload(SERVICE_NAME)
 
90
        if config.changed('listen_port') or config.changed('listen_addr'):
 
91
            stop()
 
92
            start()
 
93
        else:
 
94
            host.service_reload(SERVICE_NAME)
91
95
 
92
96
    recreate_console_shortcut()
93
97