Cat blocking when piping output from /usr/bin/gssproxy (`timeout -k 1 1 /usr/bin/gssproxy | cat` does not terminate) The 2019 Stack Overflow Developer Survey Results Are InPiping output from a segfaulting programssh “-f” don't give back hand in bash when listening to stdout/stderrTimeout doesn't occur when reading from fifo using `read`Formatting grep output with awk. Simple case and background caseWhen does cat finish reading from a pipe?Piping sed/grep output does not workWhy doesn't file redirection to and from a named pipe work, but piping to cat does?Opening named pipe blocks forever, if pipe is deleted without being connectedCapturing all output from piping input into a cli programSetting variable output from timeout
Which Sci-Fi work first showed weapon of galactic-scale mass destruction?
Multiply Two Integer Polynomials
Output the Arecibo Message
Deal with toxic manager when you can't quit
What tool would a Roman-age civilization have for the breaking of silver and other metals into dust?
Do these rules for Critical Successes and Critical Failures seem Fair?
Does a dangling wire really electrocute me if I'm standing in water?
Delete all lines which don't have n characters before delimiter
Is three citations per paragraph excessive for undergraduate research paper?
How can I autofill dates in Excel excluding Sunday?
Is bread bad for ducks?
Geography at the pixel level
What did it mean to "align" a radio?
How to save as into a customized destination on macOS?
Why isn't the circumferential light around the M87 black hole's event horizon symmetric?
What do the Banks children have against barley water?
The difference between dialogue marks
Origin of "cooter" meaning "vagina"
Time travel alters history but people keep saying nothing's changed
How to deal with fear of taking dependencies
Building a conditional check constraint
For what reasons would an animal species NOT cross a *horizontal* land bridge?
Pokemon Turn Based battle (Python)
Identify boardgame from Big movie
Cat blocking when piping output from /usr/bin/gssproxy (`timeout -k 1 1 /usr/bin/gssproxy | cat` does not terminate)
The 2019 Stack Overflow Developer Survey Results Are InPiping output from a segfaulting programssh “-f” don't give back hand in bash when listening to stdout/stderrTimeout doesn't occur when reading from fifo using `read`Formatting grep output with awk. Simple case and background caseWhen does cat finish reading from a pipe?Piping sed/grep output does not workWhy doesn't file redirection to and from a named pipe work, but piping to cat does?Opening named pipe blocks forever, if pipe is deleted without being connectedCapturing all output from piping input into a cli programSetting variable output from timeout
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I use gssproxy under Arch Linux, in particular
Name : gssproxy
Version : 0.8.0-1
I encountered the following behavior: When trying to pipe the output of /usr/bin/gssproxy
like so
/usr/bin/gssproxy | cat
it blocks.
However, when I just run this command:/usr/bin/gssproxy it does not block, but creates another process in the background
root 13720 0.0 0.0 59732 584 ? Ssl 11:44 0:00 /usr/bin/gssproxy
and exists.
I acknowledge that there is probably no point in piping the output of gssproxy, but nevertheless I am still wondering why this behavior occurs? In particular, what causes cat to block?
EDIT:
By blocking, I mean that the following command:
timeout -k 1 1 /usr/bin/gssproxy | cat,
does not terminate, while
timeout -k 1 1 /usr/bin/gssproxy
terminates immediately. Both command spawn gssproxy process in the background. I am wondering why the first command
does not terminate after 1 second as I would expect?
pipe timeout
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I use gssproxy under Arch Linux, in particular
Name : gssproxy
Version : 0.8.0-1
I encountered the following behavior: When trying to pipe the output of /usr/bin/gssproxy
like so
/usr/bin/gssproxy | cat
it blocks.
However, when I just run this command:/usr/bin/gssproxy it does not block, but creates another process in the background
root 13720 0.0 0.0 59732 584 ? Ssl 11:44 0:00 /usr/bin/gssproxy
and exists.
I acknowledge that there is probably no point in piping the output of gssproxy, but nevertheless I am still wondering why this behavior occurs? In particular, what causes cat to block?
EDIT:
By blocking, I mean that the following command:
timeout -k 1 1 /usr/bin/gssproxy | cat,
does not terminate, while
timeout -k 1 1 /usr/bin/gssproxy
terminates immediately. Both command spawn gssproxy process in the background. I am wondering why the first command
does not terminate after 1 second as I would expect?
pipe timeout
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
How do you see that it's blocked?gssproxyis a daemon program. I would not be surprised if it simple tests to see whether it's standard output is connected to a terminal or not, and if it's not it may simply decide to not output anything (because it thinks it's running as it should be running, in the background). If it's connected to a terminal, it obviously re-executes itself in the background.
– Kusalananda♦
Apr 6 at 12:33
It might be similar to this:setsid sleep 5doesn't block (and forks sleep),setsid sleep 5 | catblocks for the duration of sleep.
– A.B
Apr 6 at 16:49
I observed the following situation:[root@d48293f221d9]# timeout -k 1 1 /usr/bin/gssproxy | cat ^C[root@d48293f221d9]# ps aux | grep gssproxy root 24131 0.0 0.0 59732 588 ? Ssl 07:44 0:00 /usr/bin/gssproxywheretimeoutdoes not cause a termination after 1 second, as I would expect. Would you have any idea why?
– MLStudent
Apr 7 at 7:45
add a comment |
I use gssproxy under Arch Linux, in particular
Name : gssproxy
Version : 0.8.0-1
I encountered the following behavior: When trying to pipe the output of /usr/bin/gssproxy
like so
/usr/bin/gssproxy | cat
it blocks.
However, when I just run this command:/usr/bin/gssproxy it does not block, but creates another process in the background
root 13720 0.0 0.0 59732 584 ? Ssl 11:44 0:00 /usr/bin/gssproxy
and exists.
I acknowledge that there is probably no point in piping the output of gssproxy, but nevertheless I am still wondering why this behavior occurs? In particular, what causes cat to block?
EDIT:
By blocking, I mean that the following command:
timeout -k 1 1 /usr/bin/gssproxy | cat,
does not terminate, while
timeout -k 1 1 /usr/bin/gssproxy
terminates immediately. Both command spawn gssproxy process in the background. I am wondering why the first command
does not terminate after 1 second as I would expect?
pipe timeout
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I use gssproxy under Arch Linux, in particular
Name : gssproxy
Version : 0.8.0-1
I encountered the following behavior: When trying to pipe the output of /usr/bin/gssproxy
like so
/usr/bin/gssproxy | cat
it blocks.
However, when I just run this command:/usr/bin/gssproxy it does not block, but creates another process in the background
root 13720 0.0 0.0 59732 584 ? Ssl 11:44 0:00 /usr/bin/gssproxy
and exists.
I acknowledge that there is probably no point in piping the output of gssproxy, but nevertheless I am still wondering why this behavior occurs? In particular, what causes cat to block?
EDIT:
By blocking, I mean that the following command:
timeout -k 1 1 /usr/bin/gssproxy | cat,
does not terminate, while
timeout -k 1 1 /usr/bin/gssproxy
terminates immediately. Both command spawn gssproxy process in the background. I am wondering why the first command
does not terminate after 1 second as I would expect?
pipe timeout
pipe timeout
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Apr 7 at 9:48
MLStudent
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Apr 6 at 11:49
MLStudentMLStudent
112
112
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
MLStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
How do you see that it's blocked?gssproxyis a daemon program. I would not be surprised if it simple tests to see whether it's standard output is connected to a terminal or not, and if it's not it may simply decide to not output anything (because it thinks it's running as it should be running, in the background). If it's connected to a terminal, it obviously re-executes itself in the background.
– Kusalananda♦
Apr 6 at 12:33
It might be similar to this:setsid sleep 5doesn't block (and forks sleep),setsid sleep 5 | catblocks for the duration of sleep.
– A.B
Apr 6 at 16:49
I observed the following situation:[root@d48293f221d9]# timeout -k 1 1 /usr/bin/gssproxy | cat ^C[root@d48293f221d9]# ps aux | grep gssproxy root 24131 0.0 0.0 59732 588 ? Ssl 07:44 0:00 /usr/bin/gssproxywheretimeoutdoes not cause a termination after 1 second, as I would expect. Would you have any idea why?
– MLStudent
Apr 7 at 7:45
add a comment |
1
How do you see that it's blocked?gssproxyis a daemon program. I would not be surprised if it simple tests to see whether it's standard output is connected to a terminal or not, and if it's not it may simply decide to not output anything (because it thinks it's running as it should be running, in the background). If it's connected to a terminal, it obviously re-executes itself in the background.
– Kusalananda♦
Apr 6 at 12:33
It might be similar to this:setsid sleep 5doesn't block (and forks sleep),setsid sleep 5 | catblocks for the duration of sleep.
– A.B
Apr 6 at 16:49
I observed the following situation:[root@d48293f221d9]# timeout -k 1 1 /usr/bin/gssproxy | cat ^C[root@d48293f221d9]# ps aux | grep gssproxy root 24131 0.0 0.0 59732 588 ? Ssl 07:44 0:00 /usr/bin/gssproxywheretimeoutdoes not cause a termination after 1 second, as I would expect. Would you have any idea why?
– MLStudent
Apr 7 at 7:45
1
1
How do you see that it's blocked?
gssproxy is a daemon program. I would not be surprised if it simple tests to see whether it's standard output is connected to a terminal or not, and if it's not it may simply decide to not output anything (because it thinks it's running as it should be running, in the background). If it's connected to a terminal, it obviously re-executes itself in the background.– Kusalananda♦
Apr 6 at 12:33
How do you see that it's blocked?
gssproxy is a daemon program. I would not be surprised if it simple tests to see whether it's standard output is connected to a terminal or not, and if it's not it may simply decide to not output anything (because it thinks it's running as it should be running, in the background). If it's connected to a terminal, it obviously re-executes itself in the background.– Kusalananda♦
Apr 6 at 12:33
It might be similar to this:
setsid sleep 5 doesn't block (and forks sleep), setsid sleep 5 | cat blocks for the duration of sleep.– A.B
Apr 6 at 16:49
It might be similar to this:
setsid sleep 5 doesn't block (and forks sleep), setsid sleep 5 | cat blocks for the duration of sleep.– A.B
Apr 6 at 16:49
I observed the following situation:
[root@d48293f221d9]# timeout -k 1 1 /usr/bin/gssproxy | cat ^C [root@d48293f221d9]# ps aux | grep gssproxy root 24131 0.0 0.0 59732 588 ? Ssl 07:44 0:00 /usr/bin/gssproxy where timeout does not cause a termination after 1 second, as I would expect. Would you have any idea why?– MLStudent
Apr 7 at 7:45
I observed the following situation:
[root@d48293f221d9]# timeout -k 1 1 /usr/bin/gssproxy | cat ^C [root@d48293f221d9]# ps aux | grep gssproxy root 24131 0.0 0.0 59732 588 ? Ssl 07:44 0:00 /usr/bin/gssproxy where timeout does not cause a termination after 1 second, as I would expect. Would you have any idea why?– MLStudent
Apr 7 at 7:45
add a comment |
1 Answer
1
active
oldest
votes
As @Kusalananda, mentions gssproxy runs as a daemon, the parent process probably wait's untill it's child exits.
Here's a short shell script which emulates the same situation.
$ cat t1
#!/bin/bash
sleep 10 &
$ date; ./t1 | cat ; date
Sun Apr 7 10:59:02 BST 2019
Sun Apr 7 10:59:12 BST 2019
The date commands are there purely to show that after the subprocess exists (10 seconds) cat terminates
Thanks! But why is it thattimeout -k 1 1 /usr/bin/gssproxy | catdoes not cause thegssproxyprocess to exit?
– MLStudent
Apr 7 at 10:14
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
MLStudent is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510894%2fcat-blocking-when-piping-output-from-usr-bin-gssproxy-timeout-k-1-1-usr-bin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As @Kusalananda, mentions gssproxy runs as a daemon, the parent process probably wait's untill it's child exits.
Here's a short shell script which emulates the same situation.
$ cat t1
#!/bin/bash
sleep 10 &
$ date; ./t1 | cat ; date
Sun Apr 7 10:59:02 BST 2019
Sun Apr 7 10:59:12 BST 2019
The date commands are there purely to show that after the subprocess exists (10 seconds) cat terminates
Thanks! But why is it thattimeout -k 1 1 /usr/bin/gssproxy | catdoes not cause thegssproxyprocess to exit?
– MLStudent
Apr 7 at 10:14
add a comment |
As @Kusalananda, mentions gssproxy runs as a daemon, the parent process probably wait's untill it's child exits.
Here's a short shell script which emulates the same situation.
$ cat t1
#!/bin/bash
sleep 10 &
$ date; ./t1 | cat ; date
Sun Apr 7 10:59:02 BST 2019
Sun Apr 7 10:59:12 BST 2019
The date commands are there purely to show that after the subprocess exists (10 seconds) cat terminates
Thanks! But why is it thattimeout -k 1 1 /usr/bin/gssproxy | catdoes not cause thegssproxyprocess to exit?
– MLStudent
Apr 7 at 10:14
add a comment |
As @Kusalananda, mentions gssproxy runs as a daemon, the parent process probably wait's untill it's child exits.
Here's a short shell script which emulates the same situation.
$ cat t1
#!/bin/bash
sleep 10 &
$ date; ./t1 | cat ; date
Sun Apr 7 10:59:02 BST 2019
Sun Apr 7 10:59:12 BST 2019
The date commands are there purely to show that after the subprocess exists (10 seconds) cat terminates
As @Kusalananda, mentions gssproxy runs as a daemon, the parent process probably wait's untill it's child exits.
Here's a short shell script which emulates the same situation.
$ cat t1
#!/bin/bash
sleep 10 &
$ date; ./t1 | cat ; date
Sun Apr 7 10:59:02 BST 2019
Sun Apr 7 10:59:12 BST 2019
The date commands are there purely to show that after the subprocess exists (10 seconds) cat terminates
answered Apr 7 at 10:05
X TianX Tian
7,83512237
7,83512237
Thanks! But why is it thattimeout -k 1 1 /usr/bin/gssproxy | catdoes not cause thegssproxyprocess to exit?
– MLStudent
Apr 7 at 10:14
add a comment |
Thanks! But why is it thattimeout -k 1 1 /usr/bin/gssproxy | catdoes not cause thegssproxyprocess to exit?
– MLStudent
Apr 7 at 10:14
Thanks! But why is it that
timeout -k 1 1 /usr/bin/gssproxy | cat does not cause the gssproxy process to exit?– MLStudent
Apr 7 at 10:14
Thanks! But why is it that
timeout -k 1 1 /usr/bin/gssproxy | cat does not cause the gssproxy process to exit?– MLStudent
Apr 7 at 10:14
add a comment |
MLStudent is a new contributor. Be nice, and check out our Code of Conduct.
MLStudent is a new contributor. Be nice, and check out our Code of Conduct.
MLStudent is a new contributor. Be nice, and check out our Code of Conduct.
MLStudent is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510894%2fcat-blocking-when-piping-output-from-usr-bin-gssproxy-timeout-k-1-1-usr-bin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
How do you see that it's blocked?
gssproxyis a daemon program. I would not be surprised if it simple tests to see whether it's standard output is connected to a terminal or not, and if it's not it may simply decide to not output anything (because it thinks it's running as it should be running, in the background). If it's connected to a terminal, it obviously re-executes itself in the background.– Kusalananda♦
Apr 6 at 12:33
It might be similar to this:
setsid sleep 5doesn't block (and forks sleep),setsid sleep 5 | catblocks for the duration of sleep.– A.B
Apr 6 at 16:49
I observed the following situation:
[root@d48293f221d9]# timeout -k 1 1 /usr/bin/gssproxy | cat ^C[root@d48293f221d9]# ps aux | grep gssproxy root 24131 0.0 0.0 59732 588 ? Ssl 07:44 0:00 /usr/bin/gssproxywheretimeoutdoes not cause a termination after 1 second, as I would expect. Would you have any idea why?– MLStudent
Apr 7 at 7:45