2

I defined a Linux systemd service which has few dependencies in unit file using After= and Requires=. My service depends also on SAN filesystems controlled by Veritas.

When stopping my service upon shutdown I noticed my service is stopped after VCS service which prevents my service from stopping gracefully (as it requires filesystems controlled by Veritas to stop which are not present).

I have following dependencies set:

[unit]
After=vcs.service vxfs.service vxvm-boot.service
Requires=vcs.service vxfs.service vxvm-boot.service

Any idea how can I set the right order during shutdown to call my service before Veritas services and which Veritas services I should depend on?

Rohit Gupta
  • 356
  • 2
  • 4
  • 14
Hellraiser
  • 21
  • 1

1 Answers1

0

From the official docs,

When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. I.e. if a unit is configured with After= on another unit, the former is stopped before the latter if both are shut down.

Given what you have documented in your .service file, the services should be shut down in the proper order.

doneal24
  • 851
  • 6
  • 14