open-iscsi.service 987 B

12345678910111213141516171819202122232425262728293031
  1. [Unit]
  2. Description=Login to default iSCSI targets
  3. Documentation=man:iscsiadm(8) man:iscsid(8)
  4. Wants=network-online.target remote-fs-pre.target
  5. After=network-online.target iscsid.service
  6. Before=remote-fs-pre.target
  7. DefaultDependencies=no
  8. Conflicts=shutdown.target
  9. Before=shutdown.target
  10. # Must have some pre-defined targets to login to
  11. ConditionDirectoryNotEmpty=|/etc/iscsi/nodes
  12. # or have a session to use via iscsid
  13. ConditionDirectoryNotEmpty=|/sys/class/iscsi_session
  14. [Service]
  15. Type=oneshot
  16. RemainAfterExit=true
  17. # iscsiadm --login will return 21 if no nodes are configured,
  18. # and 15 if a session is alread logged in (which we do not
  19. # consider an error)
  20. SuccessExitStatus=15 21
  21. # Note: iscsid will be socket activated by iscsiadm
  22. ExecStart=/sbin/iscsiadm -m node --loginall=automatic
  23. ExecStart=/lib/open-iscsi/activate-storage.sh
  24. ExecStop=/lib/open-iscsi/umountiscsi.sh
  25. ExecStop=/bin/sync
  26. ExecStop=/lib/open-iscsi/logout-all.sh
  27. [Install]
  28. WantedBy=sysinit.target
  29. Alias=iscsi.service