DevHeads.net

Question regarding systemd service unit cleanup

Hi,

I have removed dependency on service B from service A and all references to service B. The new package works well for fresh install (service A can be started normally), but it does not work for upgrades from previous versions where service A used to depend on service B (starting service A fails as it can't fine the service unit for service B). After upgrade from a previous version of the package, I noticed that a symlink to service B is left under /etc/system/system/A.service.requires dir that is causing the issue:
# ls -l /etc/systemd/system/A.service.requires
total 0
lrwxrwxrwx. 1 root root 45 Oct 8 11:10 B.service -> /usr/lib/systemd/system/B.service

Basically, some cleanup is needed to remove the requires symlink that is no longer needed.

Any advice/examples of such cleanup?

Thanks in advance,
Ravindra