Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903978 - www-apps/sonarr- process remains after stopping service
Summary: www-apps/sonarr- process remains after stopping service
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Michael Crawford (ali3nx)
Depends on:
Reported: 2023-04-07 12:43 UTC by lg188
Modified: 2023-07-18 12:33 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---

emerge --info output (emerge-info.txt,17.28 KB, text/plain)
2023-04-28 11:25 UTC, lg188

Note You need to log in before you can comment on or make changes to this bug.
Description lg188 2023-04-07 12:43:51 UTC
After starting and stopping the openrc service a process remains (mono /opt/sonarr/Sonarr.exe) and the service is still reachable through a browser.
The expected behaviour is that the service is shut down. 

I noticed that the shell script (/opt/sonarr/Sonarr) does stop, but the called Sonarr.exe instance does not stop.
The SIGTERM doesn't reach the spawned process?
Comment 1 Michael Crawford (ali3nx) 2023-04-10 19:47:38 UTC
I offer that this uncommon consequential symptom can happen with sonarr in general and also can occur with systemd however it should be uncommon. The reliance on mono by sonarr occasionally produces some runtime quirks such as the reported symptom.  
If I ever encounter this I'll attempt to kill the mono process id and restart sonarr. If you've had to attempt that repeatedly and the same behaviour symptom reoccurs I might question of there are contributing gentoo system config reasons why that has reoccurred.
There are many potential varying factors of gentoo system builds that may contribute to general system reliability concerns. If your running a full unstable gentoo system build configured with ACCEPT_KEYWORDS=~arch" general system stability concerns can be far more common including unresponsive system processes.
Comment 2 Michael Crawford (ali3nx) 2023-04-10 19:50:15 UTC
@lg188 can you provide the logfile result of emerge --info >emerge-info.log
Comment 3 lg188 2023-04-28 11:25:37 UTC
Created attachment 860883 [details]
emerge --info output
Comment 4 Michael Crawford (ali3nx) 2023-04-28 14:46:46 UTC
Thanks for submitting that information. without the capability to review that It wouldn't have been possible to determine your system configuration is essentially a science experiment build in some significant ways that could potentially be corrected.  

As I suspected you have a full unstable system build configuration. More of a gentoo system build overall can just be less reliable as a result.

configuring ACCEPT_KEYWORDS="~amd64" will provide assurances that some application instability are more likely to be consequentially suspected root causes for system application instability.
It also appears you have fish shell set as the root environment user shell and that's not recommended at all.


fish when used for root user shell environments breaks gentoo's reliance on bash scripted /etc/env.d environment configurations that set the PATH and other important environment configurations.

I spotted something potentially unusual in emerge --info that may potentially be related to a root cause of system instability.


If i recall correctly this config variable is only used to allow force downgrading glibc versions that would imply a risk of breaking a gentoo install.

There's a few major key root causes provided by your system build that likely could cause system instability. Science experiment builds will do that. the newest mono version and what produced it will more commonly provide the results you've reported.

If you reverted to full stable with mixed testing packages by only using unstable packages selectively with package.accept.keywords I'm confident the symptoms you reported would not occur.

I cannot reproduce the behaviour on my stable gentoo server that uses some mixed testing masked packages.

Can you also provide your make.conf config file?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-29 09:57:34 UTC
Their system config looks fine other than the I_KNOW variable. Using ~arch is fine and not something we should be harshly recommending against. Please don't do that.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-29 09:58:29 UTC
also not sure what the mono comment is about, there's only one in tree anyway and it's stable..?
Comment 7 PF4Public 2023-07-18 12:33:18 UTC
I can confirm this issue on openrc.

This could happen due to mono. It may be forking or something like that and therefore wrong pid got recorded, thus it attempts to stop the wrong process.

On the other hand, they allegedly plan dropping mono and starting using dotnet at or after version 4. This should unify sonarr with other *arr packages. Others [*arr packages] do in fact stop upon request. Although sometimes crash in the process, but that might be another issue.

I glanced through their sources and it appears they may somehow expose the real pid: I suspect this may be used in the meanwhile as a temporary solution, but I doubt it being a "grave" issue needing a fix ASAP.