I want to disable and remove a systemd service

Hi,
As the title says I want to completely disable and remove a service.
The offending service is the three nvidia.services, it is the boot, hibernate and resume.
Why I would like to remove it. In the Yast services manager I set this services to manual
but every time I zypper dup it reverts to on boot, and ruins my display detection coming from suspend.
I can see tots from the net but there might be a tumbleweed way of doing it, and I respect the experts advises here
just to be sure that I will be doing it right.

Thanks everyone in advance.

Hi
The easiest way is to stop, disable and mask…


systemctl stop <service1> <service2> etc
systemdctl disable <service1>
systemctl mask <service1>

You can do them all at the same time as well…

Thanks for your help.

During my zypper dup yesterday the problem came back again.
I spent sometime figuring out what’s causing the problem to re occur.
Then I remember the nvidia services I masked. I unmask the services
and set it to manually start and the problem was gone.
Conclusion, just masking the services did not solve the problem.

Your problem was to disable and “remove” those services. You got an answer and it did so, Thus th problem as defined is solved.

When you tried to do this disabling/masking to solve something different, that may be, but it wasn’t the subject of this thread, nor do we know what it was.

Thus when your original problem (for which you thought that the solution was to disable some services) is not solved by disabling those services, then better start a new thread with a title and description that describe your real problem.

I think my previous post is relevant in my opinion, malcolm’s recommendation was to use mask and my post above was pertaining to masking which is part of this thread.
It is just unfortunate that mask did not do the trick.
Well sorry I can’t resist, mask is trending all over the world.:wink:

Hi
I would guess it’s a service to rebuild the driver? I install the hardway (driver, cuda and cudnn) so never see those services :wink:

And the masking worked. Thus your problem “I want to disable and remove a systemd service” was and still is: solved.

Hi,
That’s strange, I always and still install the hardway and I have those services. I don’t see those services before, and It’s just showed
just a month or two after a zypper dup on tumbleweed.

Hi
Ahh, I found them :slight_smile: they are all disabled…


nvidia-hibernate.service  nvidia-resume.service     nvidia-suspend.service

For me I use nvidia as an offload device only, plus I don’t suspend/hibernate…

http://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/powermanagement.html

Hi,
Thanks for the link.
The link was different from what was created in tumbleweed when the .run nvidia driver from nvidia download site is installed.
This is the file created that is not the same in the link ;

/usr/share/doc/NVIDIA_GLX-1.0/samples/nvidia-persistenced-init.tar.bz2

When I untar the tar.bz2 file above, this is what I got up to the last containing file that belongs to systemd.
/usr/share/doc/NVIDIA_GLX-1.0/samples/nvidia-persistenced-init/systemd/nvidia-persistenced.service.template
Thanks.

The proprietary nvidia driver, I found out every install after a newer kernel arrives in tumbleweed triggers the nvidia services to start on boot.
So tumbleweed I think is not at fault here, it’s the proprietary nvidia driver.

Probably I may need a guide to make this thing work instead of removing which this thread was intended, so I may need to start another thread
to ask help for making it work.

Thanks.

I did some reading in the nvidia doc. and saw the option

"--no-systemd"

when running the .run installer.
Problem solved.

Were you masking before stopping and disabling? NAICT, masking should prevent re-enabling (only) if first disabled before masking.

It didn’t work. What happens is every time there is new kernel update when reinstalling the .run nvidia driver, it automatically install and enable the systemd nvidia services.
That’s the reason why masking and disabling will not work because the nvidia installer reinstall it and automagically configure it to start on boot.
I think it was working in regards to the machine, the problem is with the display that fails to wake up.

I would try setting the immutable flag on the mask-unit file.

Change the preset: man systemd.preset

Well, there are three nvidia services and dealing with systemd configuration is not as easy vs.
just adding in .run --no-systemd.

Thanks all for your inputs, they are helpful and most appreciated.
Those suggestions are really interesting and educational that I can
visit when another problem arise with a similar situation.

People in this forum are really good, patient and polite in helping others.
Keep up the good work and have a lot of fun.