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
Spanish for "widget"
Why isn't airport relocation done gradually?
How long do I have to send payment?
Should I use my personal or workplace e-mail when registering to external websites for work purpose?
How come people say “Would of”?
How to create dashed lines/arrows in Illustrator
Why do UK politicians seemingly ignore opinion polls on Brexit?
Patience, young "Padovan"
Does a dangling wire really electrocute me if I'm standing in water?
How to manage monthly salary
Dual Citizen. Exited the US on Italian passport recently
Is domain driven design an anti-SQL pattern?
Inversion Puzzle
Pristine Bit Checking
"To split hairs" vs "To be pedantic"
A poker game description that does not feel gimmicky
Does it makes sense to buy a new cycle to learn riding?
"Riffle" two strings
Where to refill my bottle in India?
Monty Hall variation
"What time...?" or "At what time...?" - what is more grammatically correct?
Time travel alters history but people keep saying nothing's changed
What can other administrators access on my machine?
What tool would a Roman-age civilization have to grind silver and other metals into dust?
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?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
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
wheretimeout
does not cause a termination after 1 second, as I would expect. Would you have any idea why?
– MLStudent
2 days ago
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 2 days ago
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?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
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
wheretimeout
does not cause a termination after 1 second, as I would expect. Would you have any idea why?
– MLStudent
2 days ago
add a comment |
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
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
wheretimeout
does not cause a termination after 1 second, as I would expect. Would you have any idea why?
– MLStudent
2 days ago
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
2 days ago
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
2 days ago
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 | cat
does not cause thegssproxy
process to exit?
– MLStudent
2 days ago
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 | cat
does not cause thegssproxy
process to exit?
– MLStudent
2 days ago
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 | cat
does not cause thegssproxy
process to exit?
– MLStudent
2 days ago
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 2 days ago
X TianX Tian
7,83512237
7,83512237
Thanks! But why is it thattimeout -k 1 1 /usr/bin/gssproxy | cat
does not cause thegssproxy
process to exit?
– MLStudent
2 days ago
add a comment |
Thanks! But why is it thattimeout -k 1 1 /usr/bin/gssproxy | cat
does not cause thegssproxy
process to exit?
– MLStudent
2 days ago
Thanks! But why is it that
timeout -k 1 1 /usr/bin/gssproxy | cat
does not cause the gssproxy
process to exit?– MLStudent
2 days ago
Thanks! But why is it that
timeout -k 1 1 /usr/bin/gssproxy | cat
does not cause the gssproxy
process to exit?– MLStudent
2 days ago
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?
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
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
wheretimeout
does not cause a termination after 1 second, as I would expect. Would you have any idea why?– MLStudent
2 days ago