{"action":"created","issue":{"url":"https://api.github.com/repos/habitat-sh/habitat/issues/5409","repository_url":"https://api.github.com/repos/habitat-sh/habitat","labels_url":"https://api.github.com/repos/habitat-sh/habitat/issues/5409/labels{/name}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/issues/5409/comments","events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/5409/events","html_url":"https://github.com/habitat-sh/habitat/pull/5409","id":347072266,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NzgyMDU5","number":5409,"title":"Upgrade sup on sighup","user":{"login":"baumanj","id":5906042,"node_id":"MDQ6VXNlcjU5MDYwNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/5906042?v=4","gravatar_id":"","url":"https://api.github.com/users/baumanj","html_url":"https://github.com/baumanj","followers_url":"https://api.github.com/users/baumanj/followers","following_url":"https://api.github.com/users/baumanj/following{/other_user}","gists_url":"https://api.github.com/users/baumanj/gists{/gist_id}","starred_url":"https://api.github.com/users/baumanj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baumanj/subscriptions","organizations_url":"https://api.github.com/users/baumanj/orgs","repos_url":"https://api.github.com/users/baumanj/repos","events_url":"https://api.github.com/users/baumanj/events{/privacy}","received_events_url":"https://api.github.com/users/baumanj/received_events","type":"User","site_admin":false},"labels":[{"id":978537014,"node_id":"MDU6TGFiZWw5Nzg1MzcwMTQ=","url":"https://api.github.com/repos/habitat-sh/habitat/labels/X-feature","name":"X-feature","color":"c61d6f","default":false}],"state":"open","locked":false,"assignee":{"login":"baumanj","id":5906042,"node_id":"MDQ6VXNlcjU5MDYwNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/5906042?v=4","gravatar_id":"","url":"https://api.github.com/users/baumanj","html_url":"https://github.com/baumanj","followers_url":"https://api.github.com/users/baumanj/followers","following_url":"https://api.github.com/users/baumanj/following{/other_user}","gists_url":"https://api.github.com/users/baumanj/gists{/gist_id}","starred_url":"https://api.github.com/users/baumanj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baumanj/subscriptions","organizations_url":"https://api.github.com/users/baumanj/orgs","repos_url":"https://api.github.com/users/baumanj/repos","events_url":"https://api.github.com/users/baumanj/events{/privacy}","received_events_url":"https://api.github.com/users/baumanj/received_events","type":"User","site_admin":false},"assignees":[{"login":"baumanj","id":5906042,"node_id":"MDQ6VXNlcjU5MDYwNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/5906042?v=4","gravatar_id":"","url":"https://api.github.com/users/baumanj","html_url":"https://github.com/baumanj","followers_url":"https://api.github.com/users/baumanj/followers","following_url":"https://api.github.com/users/baumanj/following{/other_user}","gists_url":"https://api.github.com/users/baumanj/gists{/gist_id}","starred_url":"https://api.github.com/users/baumanj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baumanj/subscriptions","organizations_url":"https://api.github.com/users/baumanj/orgs","repos_url":"https://api.github.com/users/baumanj/repos","events_url":"https://api.github.com/users/baumanj/events{/privacy}","received_events_url":"https://api.github.com/users/baumanj/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-08-02T15:51:38Z","updated_at":"2018-08-08T20:37:34Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/habitat-sh/habitat/pulls/5409","html_url":"https://github.com/habitat-sh/habitat/pull/5409","diff_url":"https://github.com/habitat-sh/habitat/pull/5409.diff","patch_url":"https://github.com/habitat-sh/habitat/pull/5409.patch"},"body":"This requires [Add the ability to handle SIGHUP](https://github.com/habitat-sh/core/pull/49) in the `core` repo to be merged first.\r\n\r\nThe logic is the same as for automatic updates, but does not require the\r\nsupervisor be started with the `-A` flag. The SIGHUP can be sent to either the\r\nlauncher or supervisor process. If there is a newer supervisor available, the\r\nold supervisor will exit, but not the services.\r\n\r\nThis is currently based on [launcher-simplify-reload-logic](https://github.com/habitat-sh/habitat/pull/5404) since merging is blocked due to release freeze. Please review just the commit that is on top of that: \r\nhttps://github.com/habitat-sh/habitat/commit/d1ef324883042aedd53c7630c72edd303f625766\r\n\r\nBehavior demonstrated (some logs elided for clarity):\r\n```\r\n➤ env TESTING_FS_ROOT=(mktemp -d)  HAB_SUP_BINARY=(pwd)/target/debug/hab-sup HAB_LAUNCH_BINARY=(pwd)/target/debug/hab-launch hab sup run\r\nDEBUG 2018-08-02T17:10:41Z: habitat_launcher::server: Starting Supervisor \"/home/jbauman/habitat/target/debug/hab-sup\" with args [\"run\"], HAB_LAUNCHER_PIPE=/tmp/rust-ipc-socket.o3ZHT4...\r\n…\r\nDEBUG 2018-08-02T17:10:41Z: habitat_sup::manager: new(cfg: ManagerConfig { auto_update: false, custom_state_path: None, eventsrv_group: None, update_url: \"https://bldr.habitat.sh\", update_channel: \"stable\", gossip_listen: GossipListenAddr(V4(0.0.0.0:9638)), ctl_listen: V4(127.0.0.1:9632), http_listen: ListenAddr(V4(0.0.0.0:9631)), gossip_peers: [], gossip_permanent: false, ring_key: None, name: None, organization: None, watch_peer_file: None }, fs_cfg: FsCfg { butterfly_data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data/butterfly.dat\", census_data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data/census.dat\", services_data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data/services.dat\", sup_root: \"/tmp/tmp.quGKYTwqTg/hab/sup/default\", data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data\", specs_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/specs\", composites_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/composites\", member_id_file: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/MEMBER_ID\", proc_lock_file: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/LOCK\" }\r\nDEBUG 2018-08-02T17:10:41Z: habitat_sup::manager: current: core/hab-sup/0.60.0-dev\r\nhab-sup(MR): Supervisor Member-ID 51f103bf27274a14803373b8ade569fd\r\nDEBUG 2018-08-02T17:10:41Z: habitat_sup::manager::spec_watcher: SpecWatcher(/tmp/tmp.quGKYTwqTg/hab/sup/default/specs) thread starting\r\nhab-sup(MR): Starting gossip-listener on 0.0.0.0:9638\r\n```\r\nIn another shell:\r\n```\r\n➤ pgrep -afl  hab-\r\n87557 /home/jbauman/habitat/target/debug/hab-launch run\r\n87559 /home/jbauman/habitat/target/debug/hab-sup run\r\n\r\n➤ pkill -HUP hab-launch\r\n```\r\nAnd then back to the Supervisor logs, we see the install happen and the supervisor restarts, but because of the `HAB_SUP_BINARY`, we end up with the same supervisor running again (as expected).\r\n```\r\nDEBUG 2018-08-02T17:10:58Z: habitat_common::command::package::install: install key_cache_path: /home/jbauman/.hab/cache/keys\r\n…\r\nDEBUG 2018-08-02T17:11:02Z: habitat_sup::manager::self_updater: Self updater installing newer Supervisor, core/hab-sup/0.59.0/20180712161546\r\nhab-sup(MR): Supervisor shutting down for automatic update to core/hab-sup/0.59.0/20180712161546\r\nhab-sup(MR): Gracefully departing from butterfly network.\r\n…\r\nDEBUG 2018-08-02T17:11:02Z: hab_sup: start() returned Ok(()); Exiting 0\r\nDEBUG 2018-08-02T17:11:02Z: habitat_launcher::server: Reaped supervisor process, PID 87559\r\n WARN 2018-08-02T17:11:02Z: habitat_launcher::server: Error waiting for child process: -1\r\nDEBUG 2018-08-02T17:11:02Z: habitat_launcher::server: Supervisor exit status: 0\r\nDEBUG 2018-08-02T17:11:02Z: habitat_launcher::server: launcher::server::handle_supervisor_exit(code: Some(0))\r\nDEBUG 2018-08-02T17:11:02Z: habitat_launcher::server: tick() returned error Error waiting for Supervisor to shutdown. Attempting to restart server\r\nERROR 2018-08-02T17:11:02Z: habitat_launcher::server: Supervised exited; will restart in 5 secs...\r\n…\r\nDEBUG 2018-08-02T17:11:07Z: habitat_launcher::server: Starting Supervisor \"/home/jbauman/habitat/target/debug/hab-sup\" with args [\"run\"], HAB_LAUNCHER_PIPE=/tmp/rust-ipc-socket.ylIr1M...\r\n…\r\nDEBUG 2018-08-02T17:11:07Z: habitat_sup::manager: new(cfg: ManagerConfig { auto_update: false, custom_state_path: None, eventsrv_group: None, update_url: \"https://bldr.habitat.sh\", update_channel: \"stable\", gossip_listen: GossipListenAddr(V4(0.0.0.0:9638)), ctl_listen: V4(127.0.0.1:9632), http_listen: ListenAddr(V4(0.0.0.0:9631)), gossip_peers: [], gossip_permanent: false, ring_key: None, name: None, organization: None, watch_peer_file: None }, fs_cfg: FsCfg { butterfly_data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data/butterfly.dat\", census_data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data/census.dat\", services_data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data/services.dat\", sup_root: \"/tmp/tmp.quGKYTwqTg/hab/sup/default\", data_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/data\", specs_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/specs\", composites_path: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/composites\", member_id_file: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/MEMBER_ID\", proc_lock_file: \"/tmp/tmp.quGKYTwqTg/hab/sup/default/LOCK\" }\r\nDEBUG 2018-08-02T17:11:07Z: habitat_sup::manager: current: core/hab-sup/0.60.0-dev\r\nhab-sup(MR): Supervisor Member-ID 51f103bf27274a14803373b8ade569fd\r\n```\r\nIn the other shell, we can see that the supervisor exits after the `SIGHUP` and then restarts, but the `hab-launch` never changes:\r\n```\r\n➤ pgrep -afl  hab-\r\n87557 /home/jbauman/habitat/target/debug/hab-launch run\r\n87559 /home/jbauman/habitat/target/debug/hab-sup run\r\n\r\n➤ pkill -HUP hab-launch\r\n\r\n➤ pgrep -afl  hab-\r\n87557 /home/jbauman/habitat/target/debug/hab-launch run\r\n\r\n➤ pgrep -afl  hab-\r\n87557 /home/jbauman/habitat/target/debug/hab-launch run\r\n87737 /home/jbauman/habitat/target/debug/hab-sup run\r\n```"},"comment":{"url":"https://api.github.com/repos/habitat-sh/habitat/issues/comments/411544042","html_url":"https://github.com/habitat-sh/habitat/pull/5409#issuecomment-411544042","issue_url":"https://api.github.com/repos/habitat-sh/habitat/issues/5409","id":411544042,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTU0NDA0Mg==","user":{"login":"christophermaier","id":207178,"node_id":"MDQ6VXNlcjIwNzE3OA==","avatar_url":"https://avatars2.githubusercontent.com/u/207178?v=4","gravatar_id":"","url":"https://api.github.com/users/christophermaier","html_url":"https://github.com/christophermaier","followers_url":"https://api.github.com/users/christophermaier/followers","following_url":"https://api.github.com/users/christophermaier/following{/other_user}","gists_url":"https://api.github.com/users/christophermaier/gists{/gist_id}","starred_url":"https://api.github.com/users/christophermaier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophermaier/subscriptions","organizations_url":"https://api.github.com/users/christophermaier/orgs","repos_url":"https://api.github.com/users/christophermaier/repos","events_url":"https://api.github.com/users/christophermaier/events{/privacy}","received_events_url":"https://api.github.com/users/christophermaier/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T20:37:34Z","updated_at":"2018-08-08T20:37:34Z","author_association":"CONTRIBUTOR","body":"@stevendanna I wonder if there's another mode of operation here; namely, \"just restart the Supervisor\". This wouldn't check Builder for something new, but if you've installed a newer Supervisor package locally, then when it restarted, it'd pick that up automatically. That would work in air-gapped environments, and you wouldn't technically need to bother with the symlinks. Do you think that would that work for you?"}}
{"actor":{"display_login":"christophermaier"}}