Comment 8 for bug 1294267

Revision history for this message
Rarylson Freitas (rarylson) wrote :

Hi everyone.

It seems like the TGT bug (when stopping, reloading or restarting the TGT deamon) is solved in Ubuntu Artful (17.10). I did not make tests, but now TGT uses the upstream init.d script or the TGT systemd config file (both of them address all of the previous described problems).

The commands `tgtadm --op update --mode sys --name State -v offline`, `tgt-admin --offline ALL` and `tgt-admin -e -c /etc/tgt/targets.conf`, for example, correctly turns TGT down (the to first commands) and reloads in the correct way (the last command).

I think this bug report can be closed now, since it seems to be solved in newer versions.

Below, the systemd tgt service config file:

```
[Unit]
Description=(i)SCSI target daemon
Documentation=man:tgtd(8)
After=network.target

[Service]
Type=notify
TasksMax=infinity
ExecStart=/usr/sbin/tgtd -f
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v offline
ExecStartPost=/usr/sbin/tgt-admin -e -c /etc/tgt/targets.conf
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v ready

ExecStop=/usr/sbin/tgtadm --op update --mode sys --name State -v offline
ExecStop=/usr/sbin/tgt-admin --offline ALL
ExecStop=/usr/sbin/tgt-admin --update ALL -c /dev/null -f
ExecStop=/usr/sbin/tgtadm --op delete --mode system

ExecReload=/usr/sbin/tgt-admin --update ALL -c /etc/tgt/targets.conf
Restart=on-failure

[Install]
WantedBy=multi-user.target
```