)]}'
{"elements/rebind-sshd/README.rst":[{"author":{"_account_id":15226,"name":"Bharath M","email":"bharath.stacker@gmail.com","username":"bharath"},"change_message_id":"10e9d174456cf1171710c6dfc68fc05edadd2f48","unresolved":false,"context_lines":[{"line_number":1,"context_line":"This element adds a post-BOUND script to the dhclient configuration to rebind"},{"line_number":2,"context_line":"the ssh daemon to listen only on the management network interface (ie. eth0,"},{"line_number":3,"context_line":"and the only interface that will get its address via dhcp on boot). The reason"},{"line_number":4,"context_line":"for doing this is that some use cases require load balancing services on TCP"},{"line_number":5,"context_line":"port 22 to work, and if SSH binds to the wildcard interface, then haproxy"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7af24918_5447291d","line":2,"range":{"start_line":2,"start_character":66,"end_line":2,"end_character":76},"updated":"2016-03-04 21:43:57.000000000","message":"Now as you changed the code, can we also reword this ? :-)","commit_id":"d8f019cf756d8cf45605a14a8717174aad3016d9"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"971fb9ad077254d938917fcb8ed995ef2113780d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"This element adds a post-BOUND script to the dhclient configuration to rebind"},{"line_number":2,"context_line":"the ssh daemon to listen only on the management network interface (ie. eth0,"},{"line_number":3,"context_line":"and the only interface that will get its address via dhcp on boot). The reason"},{"line_number":4,"context_line":"for doing this is that some use cases require load balancing services on TCP"},{"line_number":5,"context_line":"port 22 to work, and if SSH binds to the wildcard interface, then haproxy"}],"source_content_type":"text/x-rst","patch_set":3,"id":"7af24918_54cd695c","line":2,"range":{"start_line":2,"start_character":66,"end_line":2,"end_character":76},"in_reply_to":"7af24918_5447291d","updated":"2016-03-04 21:56:58.000000000","message":"Oh yes. Duh.","commit_id":"d8f019cf756d8cf45605a14a8717174aad3016d9"}],"elements/rebind-sshd/finalise.d/98-rebind-sshd-after-dhcp":[{"author":{"_account_id":15226,"name":"Bharath M","email":"bharath.stacker@gmail.com","username":"bharath"},"change_message_id":"b7e4f2cdf80c7c5794bd5cd420dc68692640939a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/bin/bash"},{"line_number":2,"context_line":"echo \u0027#!/bin/sh"},{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" -a \"$interface\" \u003d \"eth0\" ]; then"},{"line_number":4,"context_line":"    /bin/sed -i \"s/^#*ListenAddress *[0-9]*\\..*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":5,"context_line":"    if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":6,"context_line":"        /usr/sbin/service ssh restart"}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"7af24918_9942b3ac","line":3,"range":{"start_line":3,"start_character":43,"end_line":3,"end_character":49},"updated":"2016-03-04 09:45:10.000000000","message":"I remember Ubuntu has departed from traditional interface naming scheme in the latest releases. So, is it safe to hardcode this rather than dynamically fetching the interface name from it\u0027s ip address or from /etc/interfaces file ?","commit_id":"3bde89fa455c78381e8ecc76f0e1fb1d23b8a1a1"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"0e12ae47bb4f4d94304907629ff2f675aae04184","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/bin/bash"},{"line_number":2,"context_line":"echo \u0027#!/bin/sh"},{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" -a \"$interface\" \u003d \"eth0\" ]; then"},{"line_number":4,"context_line":"    /bin/sed -i \"s/^#*ListenAddress *[0-9]*\\..*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":5,"context_line":"    if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":6,"context_line":"        /usr/sbin/service ssh restart"}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"7af24918_c1b8a4eb","line":3,"range":{"start_line":3,"start_character":43,"end_line":3,"end_character":49},"in_reply_to":"7af24918_49b84011","updated":"2016-03-04 17:33:18.000000000","message":"Aah, you\u0027re right. I\u0027ll update this to remove the \"eth0\" part of the check. In any case, the LB management interface should only ever be the only one that gets its IP address via dhcp.","commit_id":"3bde89fa455c78381e8ecc76f0e1fb1d23b8a1a1"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"71c1253002455da80ea24f51c69550556b5b00cc","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/bin/bash"},{"line_number":2,"context_line":"echo \u0027#!/bin/sh"},{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" -a \"$interface\" \u003d \"eth0\" ]; then"},{"line_number":4,"context_line":"    /bin/sed -i \"s/^#*ListenAddress *[0-9]*\\..*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":5,"context_line":"    if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":6,"context_line":"        /usr/sbin/service ssh restart"}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"7af24918_49b84011","line":3,"range":{"start_line":3,"start_character":43,"end_line":3,"end_character":49},"in_reply_to":"7af24918_9942b3ac","updated":"2016-03-04 16:36:07.000000000","message":"I agree.  We do not hard code eth0 anywhere else in the code (tests use it, but not the code) because it can be under a different name on different platforms.  Specifically the RedHat tribe uses em0 if I remember correctly.","commit_id":"3bde89fa455c78381e8ecc76f0e1fb1d23b8a1a1"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"d4331dd0ad6098f0da37af57dda1ce46f1b679f8","unresolved":false,"context_lines":[{"line_number":2,"context_line":"echo \u0027#!/bin/sh"},{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" ]; then"},{"line_number":4,"context_line":"    if `grep -q \"#ListenAddress 0.0.0.0\" /etc/ssh/sshd_config`; then"},{"line_number":5,"context_line":"        /bin/sed -i \"s/^#ListenAddress 0.0.0.0.*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":6,"context_line":"        if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":7,"context_line":"            /usr/sbin/service ssh restart"},{"line_number":8,"context_line":"        fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"5aef4532_020c9eeb","line":5,"updated":"2016-03-09 20:47:30.000000000","message":"I am assuming $new_ip_address comes from the calling framework? You\u0027re not pulling this from thin air, right?","commit_id":"81c73bd1b58f5ad74eeee568282969e09f454649"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"b62ee26e1ab4030ec1ca68a77e187c95f24f9b5f","unresolved":false,"context_lines":[{"line_number":2,"context_line":"echo \u0027#!/bin/sh"},{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" ]; then"},{"line_number":4,"context_line":"    if `grep -q \"#ListenAddress 0.0.0.0\" /etc/ssh/sshd_config`; then"},{"line_number":5,"context_line":"        /bin/sed -i \"s/^#ListenAddress 0.0.0.0.*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":6,"context_line":"        if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":7,"context_line":"            /usr/sbin/service ssh restart"},{"line_number":8,"context_line":"        fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"5aef4532_021f7e6c","line":5,"in_reply_to":"5aef4532_020c9eeb","updated":"2016-03-09 21:03:20.000000000","message":"Yep:  http://linux.die.net/man/8/dhclient-script","commit_id":"81c73bd1b58f5ad74eeee568282969e09f454649"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"d4331dd0ad6098f0da37af57dda1ce46f1b679f8","unresolved":false,"context_lines":[{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" ]; then"},{"line_number":4,"context_line":"    if `grep -q \"#ListenAddress 0.0.0.0\" /etc/ssh/sshd_config`; then"},{"line_number":5,"context_line":"        /bin/sed -i \"s/^#ListenAddress 0.0.0.0.*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":6,"context_line":"        if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":7,"context_line":"            /usr/sbin/service ssh restart"},{"line_number":8,"context_line":"        fi"},{"line_number":9,"context_line":"    fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"5aef4532_a24dea3f","line":6,"updated":"2016-03-09 20:47:30.000000000","message":"Neat trick here is:\n/bin/ps -ef|/bin/grep -q [s]shd\nIs doing it with the explicit \"grep -v grep\" more reliable?","commit_id":"81c73bd1b58f5ad74eeee568282969e09f454649"},{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"b62ee26e1ab4030ec1ca68a77e187c95f24f9b5f","unresolved":false,"context_lines":[{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" ]; then"},{"line_number":4,"context_line":"    if `grep -q \"#ListenAddress 0.0.0.0\" /etc/ssh/sshd_config`; then"},{"line_number":5,"context_line":"        /bin/sed -i \"s/^#ListenAddress 0.0.0.0.*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":6,"context_line":"        if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":7,"context_line":"            /usr/sbin/service ssh restart"},{"line_number":8,"context_line":"        fi"},{"line_number":9,"context_line":"    fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"5aef4532_c546404e","line":6,"in_reply_to":"5aef4532_a24dea3f","updated":"2016-03-09 21:03:20.000000000","message":"The \u0027grep -v grep\u0027 excludes any commands that have \u0027grep\u0027 in the command-line. This way we don\u0027t accidentally detect our script here which is meant to see whether sshd is running and assume it\u0027s actually the sshd we\u0027re looking for.  (Basically, it\u0027s like saying \"please exclude any results with \u0027grep\u0027 in the name because they\u0027ll give us false positives.\"","commit_id":"81c73bd1b58f5ad74eeee568282969e09f454649"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"dc128a9d5e342207b080cbf01da4a37ed7806ed1","unresolved":false,"context_lines":[{"line_number":3,"context_line":"if [ \"$reason\" \u003d \"BOUND\" ]; then"},{"line_number":4,"context_line":"    if `grep -q \"#ListenAddress 0.0.0.0\" /etc/ssh/sshd_config`; then"},{"line_number":5,"context_line":"        /bin/sed -i \"s/^#ListenAddress 0.0.0.0.*$/ListenAddress $new_ip_address/g\" /etc/ssh/sshd_config"},{"line_number":6,"context_line":"        if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then"},{"line_number":7,"context_line":"            /usr/sbin/service ssh restart"},{"line_number":8,"context_line":"        fi"},{"line_number":9,"context_line":"    fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"5aef4532_85dc3874","line":6,"in_reply_to":"5aef4532_c546404e","updated":"2016-03-09 21:05:05.000000000","message":"Right, the [s] in [s]shd works in a similar way -- bash parses out the [] but the command still has them, so grep doesn\u0027t match on it.","commit_id":"81c73bd1b58f5ad74eeee568282969e09f454649"}]}
