Borrar filtros
Borrar filtros

How can I stop the MathWorks Service Host from running on startup?

113 visualizaciones (últimos 30 días)
Matthew Elmer
Matthew Elmer el 1 de Ag. de 2024 a las 1:45
Editada: Mike VanHorn el 1 de Ag. de 2024 a las 16:30
How can I stop the MathWorks Service Host from running on startup?

Respuesta aceptada

Matthew Elmer
Matthew Elmer el 1 de Ag. de 2024 a las 1:54
Editada: Matthew Elmer el 1 de Ag. de 2024 a las 1:57
This answer that was given by the same person who asked the question is a lie. It's easily disabled.
The first and best option for disabling the MathWorks Service Host is to uninstall Matlab and use a better programming language.
If you are in the unfortunate position of needing to be able to run Matlab code due to its recalcitrance in being purged from our research institutions, then you can at least prevent the process from running on startup. I do not know the precise steps to disable the startup process on Windows, but you can probably find and disable it if you poke around in the startup applications settings. On Fedora 40 linux, you can either remove the entry from startup applications via Gnome Tweaks, or you can open
/home/$USER/.config/autostart/mathworks-service-host.desktop
and comment out the part that comes after the equals sign on the line that starts with Exec=, i.e., change
Exec=/home/$USER/.MathWorks/ServiceHost/-mw_shared_installs/v2024.7.0.6/bin/glnxa64/MathWorksServiceHost service --realm-id companion@prod@production
to
Exec=#/home/$USER/.MathWorks/ServiceHost/-mw_shared_installs/v2024.7.0.6/bin/glnxa64/MathWorksServiceHost service --realm-id companion@prod@production.
The audacity of MathWorks to attempt to tell me what I can and cannot do on my own computer is amusing, but foolish.
  2 comentarios
Mike VanHorn
Mike VanHorn el 1 de Ag. de 2024 a las 13:05
@Matthew Elmer This is good information, but it is useful only when the user has already run the software once. Is there a way to "pre-comment this out" before the user has run the software? I figure I can pre-create the mathworks-service-host.desktop for newly created accounts, but I don't want to have to touch every account which already exists but hasn't run R2024a yet.
I did a search through the install directory, and I didn't find a "mathworks-service-host.desktop" file that could be modified, which I think means it's either compressed somewhere waiting to be deployed when the application starts or it just creates it from scratch.
I guess what I'll do for now is put the modified "mathworks-service-host.desktop" into the skel files for new accounts, and create a script to run through all the existing home directories.
Thanks!
Mike VanHorn
Mike VanHorn el 1 de Ag. de 2024 a las 14:46
Editada: Mike VanHorn el 1 de Ag. de 2024 a las 16:30
@Matthew Elmer Further testing shows that while commenting out the line in the "mathworks-service-host.desktop" does keep the service from starting at login, the client still gets started when Matlab runs. So, my method of symlinking $HOME/.MathWorks/ServiceHost to a place in the local /tmp directory is still necessary to work around the incredible slowness associated with the creation of that directory the first time a user runs MATLAB (as the client runs from $HOME/.MathWorks/ServiceHost). For those who aren't paying attention, the Service Host installer puts 1.4GB of files into $HOME/.MathWorks/ServiceHost.
So, anyway, still looking for a way to disable the ServiceHost. But, on the bright side, it seems that the ServiceHost processes do get killed when the user logs out, so at least they aren't running rampant.

Iniciar sesión para comentar.

Más respuestas (1)

Mike VanHorn
Mike VanHorn el 1 de Ag. de 2024 a las 15:33
Editada: Mike VanHorn el 1 de Ag. de 2024 a las 15:35
Also, I can confirm this answer is at least partially false.
I tried removing $HOME/.MathWorks/ServiceHost/wilbur26/v2024.7.0.6/bin/glnxa64/MathWorksServiceHost, and while MATLAB start up was then slow, it did start up, and the licensing was fine. So MathWorksServiceHost seems to be NOT "essential for MATLAB licensing and MATLAB startup". I'm thinking it must only be related the MATLAB Connector.
However, there does, indeed, seem to be no way to disable it, and rather only work around it's slowness.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos


Versión

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by