-
-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with defuncts left by script hooks #968
Comments
I don’t know the reason, but it may be the |
Unfortunately, this wont help. I didnt have those |
Hmm that’s odd. How about replacing the |
This would be less correct and less portable, and I am sure it won't change anything. I don't know how shairport runs those scripts, but maybe just I doubt the contents of the scripts themselves can have any impact on the defuncts. |
I have been unable to reproduce the issue here. Are there any other Shairport Sync settings you have made, apart from those listed above? By default, Shairport Sync does not wait for these programs to terminate before continuing. |
Nope, its really just a plain new installation. I can do some more tests in the evening. Should I enable some sort of debug mode/logging or something? What scripts do you use? |
Thanks. I'll do the same. There is a log verbosity setting towards the end of the configuration file, or from the command line add Could you list the version of Shairport Sync ( |
Okay, so I've got some more info:
BTW when using HOWEVER, I noticed that I don't get any defuncts if I run this as To make the testcase even simpler (and to avoid permission issues) the scripts now merely contain:
So as
Now as user
And one more thing to note: So to me it looks like in some situations |
Apologies – you need to add a Regarding the difference in behaviour – is it possible that it might be related to permissions associated with membership of a particular group? I notice that the
|
I really cannot see how this could have any impact when both users are perfectly able to execute the scripts (proven by the output to console). So either it can be executed - then no permission issue, or it cannot be executed. I doubt there can be something in between. Here is the output with
|
Could you say what steps you took to create your |
BTW, I think you are correct – |
This is how I've created the user:
Groups might be a bit over the top, but well, you never know. BTW: What do you mean with "non-blocking scripts"? I think normally you would run a child process, then install a handler for |
Thanks for the suggestions. A "blocking" script is one where the player thread waits for the script to complete before continuing. It'll take a little while to come up with fix and I'll report back here. |
Ah okay, great. |
I've pushed out an update in the |
[Update] Actually I am worried about a race condition between the |
[Further update] It seems as if |
Okay wait, so I am not sure what handler you implemented, and I don't know the shairport-sync code well. In both situations ( The only other option is to set Also note that if you are using multithreading (and I saw some pthread methods in the code), traiditional unix signals will be delivered to a random thread. This is pretty much of a pain and breaks traditional signal handling. So usually you get around this by creating a dedicated thread which installs a handler for the signals using pthread-functions (not the traditional |
Thanks. I've actually implemented a system based on this: http://www.microhowto.info/howto/reap_zombie_processes_using_a_sigchld_handler.html using the standard method (not the Can you point at a discussion of the multithreading issue please? |
Okay I see. I'm afraid I don't have any documentation at hand beyond what I would find when googling it myself. |
Thanks. Looking at this pretty lucid explanation, it seems that the signal handler, when called, will run in the context of some arbitrary thread. In the case of the |
Yeah you're right, maybe in this case (only |
No more changes for this issue at present. Also nothing on the pipeline for the next week or so. |
It would be great if you could test it alright! |
I can confirm it now seems to work. I don't see any more defuncts when running as other user. |
Super. Many thanks for your help! |
This issue has been inactive for 60 days so will be closed 7 days from now. To prevent this, please remove the "stale" label or post a comment. |
I am using the following config:
The two scripts which shall be run upon start/end of playback contain:
When conneting to shairport & starting & stopping playback, I can see that the log is written:
However, every time the scripts are run, it will leave a defunct process:
Is this a bug or misconfiguration? I am on a raspberry pi 4 running rasbian buster. I have compiled & installed shairport-sync today from the latest git version.
The text was updated successfully, but these errors were encountered: