[arch-general] how to remove template service from systemd

Daniel Martin consume.noise at gmail.com
Tue Oct 6 12:09:04 UTC 2015


On 6 October 2015 at 10:35, Łukasz Michalski <lm at zork.pl> wrote:
> Hi,
>
> I have template service for VirtualBox:
>
> [root at serenity amag_kghm]# cat /etc/systemd/system/vboxvmservice at .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 at A.service - VBox Virtual Machine A Service
>    Loaded: loaded (/etc/systemd/system/vboxvmservice at .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.


More information about the arch-general mailing list