[arch-general] how to remove template service from systemd
Hi, I have template service for VirtualBox: [root@serenity amag_kghm]# cat /etc/systemd/system/vboxvmservice@.service [Unit] Description=VBox Virtual Machine %i Service Requires=systemd-modules-load.service After=systemd-modules-load.service [Service] User=zork Group=vboxusers ExecStart=/usr/bin/VBoxHeadless -s %i ExecStop=/usr/bin/VBoxManage controlvm %i savestate [Install] WantedBy=multi-user.target On of service from this template failed and I removed it. Now systemctl status vboxvmservice@* shows: ● vboxvmservice@A.service - VBox Virtual Machine A Service Loaded: loaded (/etc/systemd/system/vboxvmservice@.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2015-10-01 12:02:49 CEST; 4 days ago Main PID: 15101 (code=exited, status=0/SUCCESS) How to mak systemd forget about this service? I checked /etc/systemd/system/multi-user.target.wants/ and there is no link for my service. Regards, Łukasz
Op 6 okt. 2015 10:35 schreef "Łukasz Michalski" <lm@zork.pl>:
Hi,
I have template service for VirtualBox:
[root@serenity amag_kghm]# cat /etc/systemd/system/vboxvmservice@.service
[...]
On of service from this template failed and I removed it. Now systemctl status vboxvmservice@* shows:
● vboxvmservice@A.service - VBox Virtual Machine A Service Loaded: loaded (/etc/systemd/system/vboxvmservice@.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2015-10-01 12:02:49 CEST; 4 days ago Main PID: 15101 (code=exited, status=0/SUCCESS)
How to mak systemd forget about this service? I checked /etc/systemd/system/multi-user.target.wants/ and there is no link for my service.
If I understand correctly, the service file was removed while the service was 'active' and now systemctl still shows it's status. A reboot is probably the quickest way to get rid of this "ghost" entry. Mvg, Guus
On 10/06/2015 12:58 PM, Guus Snijders wrote:
A reboot is probably the quickest way to get rid of this "ghost" entry.
Maybe it's enough to systemctl disable vboxvmservice@A.service.
On 6 October 2015 at 10:35, Łukasz Michalski <lm@zork.pl> wrote:
Hi,
I have template service for VirtualBox:
[root@serenity amag_kghm]# cat /etc/systemd/system/vboxvmservice@.service [Unit] Description=VBox Virtual Machine %i Service Requires=systemd-modules-load.service After=systemd-modules-load.service
[Service] User=zork Group=vboxusers ExecStart=/usr/bin/VBoxHeadless -s %i ExecStop=/usr/bin/VBoxManage controlvm %i savestate
[Install] WantedBy=multi-user.target
On of service from this template failed and I removed it. Now systemctl status vboxvmservice@* shows:
● vboxvmservice@A.service - VBox Virtual Machine A Service Loaded: loaded (/etc/systemd/system/vboxvmservice@.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2015-10-01 12:02:49 CEST; 4 days ago Main PID: 15101 (code=exited, status=0/SUCCESS)
How to mak systemd forget about this service? I checked /etc/systemd/system/multi-user.target.wants/ and there is no link for my service.
If you change, add or remove service files: $ systemctl daemon-reload And you may need to stop the service as Florian wrote.
● vboxvmservice@A.service - VBox Virtual Machine A Service Loaded: loaded (/etc/systemd/system/vboxvmservice@.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2015-10-01 12:02:49 CEST; 4 days ago Main PID: 15101 (code=exited, status=0/SUCCESS)
How to mak systemd forget about this service? I checked /etc/systemd/system/multi-user.target.wants/ and there is no link for my service.
If you change, add or remove service files: $ systemctl daemon-reload
And you may need to stop the service as Florian wrote.
systemctl disable is not making this service disabled. The first call to "systemctl disable vboxvmservice@A" removed a link from /etc/systemd/system/multi-user.target.wants/ correctly. daemon-reload does not help. I suspect that reboot will get rid of it but on server I would not like to reboot just because systemctl shows failure of non existent service. Regards, Łukasz
if it's a failed service, you might need systemctl reset-failed On 7 October 2015 at 13:43, Łukasz Michalski <lm@zork.pl> wrote:
● vboxvmservice@A.service - VBox Virtual Machine A Service Loaded: loaded (/etc/systemd/system/vboxvmservice@.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2015-10-01 12:02:49 CEST; 4 days ago Main PID: 15101 (code=exited, status=0/SUCCESS)
How to mak systemd forget about this service? I checked /etc/systemd/system/multi-user.target.wants/ and there is no link for my service.
If you change, add or remove service files: $ systemctl daemon-reload
And you may need to stop the service as Florian wrote.
systemctl disable is not making this service disabled. The first call to "systemctl disable vboxvmservice@A" removed a link from /etc/systemd/system/multi-user.target.wants/ correctly.
daemon-reload does not help.
I suspect that reboot will get rid of it but on server I would not like to reboot just because systemctl shows failure of non existent service.
Regards, Łukasz
-- damjan
On 10/07/2015 04:26 PM, Damjan Georgievski wrote:
if it's a failed service, you might need systemctl reset-failed
Thanks! That did the trick! Łukasz
participants (5)
-
Damjan Georgievski
-
Daniel Martin
-
Florian Pelz
-
Guus Snijders
-
Łukasz Michalski