{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/1139","labels_url":"https://api.github.com/repos/systemd/systemd/issues/1139/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/1139/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/1139/events","html_url":"https://github.com/systemd/systemd/issues/1139","id":104845960,"number":1139,"title":"machinectl shell terminates connection","user":{"login":"mustrumr","id":1391845,"avatar_url":"https://avatars.githubusercontent.com/u/1391845?v=3","gravatar_id":"","url":"https://api.github.com/users/mustrumr","html_url":"https://github.com/mustrumr","followers_url":"https://api.github.com/users/mustrumr/followers","following_url":"https://api.github.com/users/mustrumr/following{/other_user}","gists_url":"https://api.github.com/users/mustrumr/gists{/gist_id}","starred_url":"https://api.github.com/users/mustrumr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mustrumr/subscriptions","organizations_url":"https://api.github.com/users/mustrumr/orgs","repos_url":"https://api.github.com/users/mustrumr/repos","events_url":"https://api.github.com/users/mustrumr/events{/privacy}","received_events_url":"https://api.github.com/users/mustrumr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemd/systemd/labels/machine","name":"machine","color":"bfdadc"},{"url":"https://api.github.com/repos/systemd/systemd/labels/needs-reporter-feedback","name":"needs-reporter-feedback","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-04T07:58:24Z","updated_at":"2015-09-04T18:06:05Z","closed_at":null,"body":"```\r\n(# or $, does not matter) machinectl shell\r\nConnected to the local host. Press ^] three times within 1s to exit session.\r\n\r\nConnection to the local host terminated.\r\n```\r\n\r\nAttach gdb and break in `src/machine/machinectl.c:process_forward` near `pty_forward_get_last_char(*forward, &last_char);`\r\n\r\n```\r\n(gdb) print **forward\r\n$1 = {event = 0x5555555cf9d0, master = 7, stdin_event_source = 0x5555555d3860, stdout_event_source = 0x5555555d3950, master_event_source = 0x0, sigwinch_event_source = 0x5555555d3b30, saved_stdin_attr = {\r\n    c_iflag = 27906, c_oflag = 5, c_cflag = 1215, c_lflag = 35387, c_line = 0 '\\000', c_cc = \"\\003\\034\\177\\025\\004\\000\\001\\377\\021\\023\\032\\377\\022\\017\\027\\026\\377\", '\\000' <repeats 14 times>, c_ispeed = 15, \r\n    c_ospeed = 15}, saved_stdout_attr = {c_iflag = 26624, c_oflag = 5, c_cflag = 1215, c_lflag = 2608, c_line = 0 '\\000', \r\n    c_cc = \"\\003\\034\\177\\025\\004\\000\\001\\377\\021\\023\\032\\377\\022\\017\\027\\026\\377\", '\\000' <repeats 14 times>, c_ispeed = 15, c_ospeed = 15}, read_only = false, saved_stdin = true, saved_stdout = true, \r\n  stdin_readable = false, stdin_hangup = false, stdout_writable = true, stdout_hangup = false, master_readable = false, master_writable = false, master_hangup = true, ignore_vhangup = false, \r\n  last_char_set = false, last_char = 0 '\\000', in_buffer = '\\000' <repeats 2047 times>, out_buffer = '\\000' <repeats 2047 times>, in_buffer_full = 0, out_buffer_full = 0, escape_timestamp = 0, \r\n  escape_counter = 0}\r\n```\r\n\r\n`master_hangup = true,`\r\n\r\nSo someone hanged up on us. This leads us to `src/machine/machine-dbus.c:bus_machine_method_open_shell`:\r\n```c\r\n        description = strjoina(\"Shell for User \", isempty(user) ? \"root\" : user);\r\n        r = sd_bus_message_append(tm,\r\n                                  \"(sv)(sv)(sv)(sv)(sv)(sv)(sv)(sv)(sv)(sv)(sv)(sv)(sv)\",\r\n                                  \"Description\", \"s\", description,\r\n                                  \"StandardInput\", \"s\", \"tty\",\r\n                                  \"StandardOutput\", \"s\", \"tty\",\r\n                                  \"StandardError\", \"s\", \"tty\",\r\n                                  \"TTYPath\", \"s\", pty_name,\r\n                                  \"SendSIGHUP\", \"b\", true,\r\n                                  \"IgnoreSIGPIPE\", \"b\", false,\r\n                                  \"KillMode\", \"s\", \"mixed\",\r\n                           >>>    \"TTYVHangup\", \"b\", true,\r\n                                  \"TTYReset\", \"b\", true,\r\n                                  \"UtmpIdentifier\", \"s\", utmp_id,\r\n                                  \"UtmpMode\", \"s\", \"user\",\r\n                                  \"PAMName\", \"s\", \"login\");\r\n```\r\n\r\nCould this be the reason for the hangup? Note that there is no such thing in `bus_machine_method_open_login` and no hangup is observed."},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/137807872","html_url":"https://github.com/systemd/systemd/issues/1139#issuecomment-137807872","issue_url":"https://api.github.com/repos/systemd/systemd/issues/1139","id":137807872,"user":{"login":"mustrumr","id":1391845,"avatar_url":"https://avatars.githubusercontent.com/u/1391845?v=3","gravatar_id":"","url":"https://api.github.com/users/mustrumr","html_url":"https://github.com/mustrumr","followers_url":"https://api.github.com/users/mustrumr/followers","following_url":"https://api.github.com/users/mustrumr/following{/other_user}","gists_url":"https://api.github.com/users/mustrumr/gists{/gist_id}","starred_url":"https://api.github.com/users/mustrumr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mustrumr/subscriptions","organizations_url":"https://api.github.com/users/mustrumr/orgs","repos_url":"https://api.github.com/users/mustrumr/repos","events_url":"https://api.github.com/users/mustrumr/events{/privacy}","received_events_url":"https://api.github.com/users/mustrumr/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T18:06:05Z","updated_at":"2015-09-04T18:06:05Z","body":"Happens a lot more often than not on git from one week ago and whatever Fedora Rawhide is currently using. On 794ec1eb8b29674e93f8ef20673b0f8e42903733 `machinectl shell` and `machinectl login` hangs after \r\n```\r\nConnected to the local host. Press ^] three times within 1s to exit session.\r\n```\r\n```\r\ncontainer-shell@2.service: Failed at step STDIN spawning /bin/sh: Input/output error\r\n```"}}