tgt does not auto-start on Vivid

Bug #1450091 reported by James Tunnicliffe
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Blake Rouse
tgt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

After upgrading to Vivid tgt does not start at boot. "service tgt start" does work. It looks like systemd startup files are missing.

dooferlad@homework2:/etc/systemd$ systemctl is-enabled tgt
Failed to get unit file state for tgt.service: No such file or directory

dooferlad@homework2:/etc$ dpkg -l 'tgt'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==========================-==================-==================-==========================================================
ii tgt 1:1.0.43-0ubuntu4 amd64 Linux SCSI target user-space tools

dooferlad@homework2:/etc$ sudo service tgt status
● tgt.service - LSB: iscsi target daemon
   Loaded: loaded (/etc/init.d/tgt)
   Active: active (running) since Wed 2015-04-29 15:13:21 BST; 55min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4157 ExecStart=/etc/init.d/tgt start (code=exited, status=0/SUCCESS)
   Memory: 119.3M
   CGroup: /system.slice/tgt.service
           ├─4164 tgtd
           └─4166 tgtd

Apr 29 15:13:21 homework2 tgtd[4166]: device_mgmt(246) sz:104 params:path=/var/lib/maas/boot-resources/snapshot-20150423-...t-image
Apr 29 15:13:21 homework2 tgtd[4166]: bs_thread_open(412) 16
Apr 29 15:16:32 homework2 tgtd[4166]: conn_close(103) connection closed, 0x16f4fd0 1
Apr 29 15:16:32 homework2 tgtd[4166]: conn_close(109) session 0x16f92d0 1
Apr 29 15:18:26 homework2 tgtd[4166]: conn_close(103) connection closed, 0x16f4fd0 1
Apr 29 15:18:26 homework2 tgtd[4166]: conn_close(109) session 0x16f92d0 1
Apr 29 15:43:14 homework2 tgtd[4166]: conn_close(103) connection closed, 0x16f4fd0 1
Apr 29 15:43:14 homework2 tgtd[4166]: conn_close(109) session 0x16f92d0 1
Apr 29 15:44:44 homework2 tgtd[4166]: conn_close(103) connection closed, 0x16f4fd0 1
Apr 29 15:44:44 homework2 tgtd[4166]: conn_close(109) session 0x16f92d0 1
Hint: Some lines were ellipsized, use -l to show in full.

Tags: systemd-boot

Related branches

Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Ah, ugly, it seems that sudo systemctl enable tgt does work, even though some parts fail:

dooferlad@homework2:/etc$ sudo systemctl enable tgt
Synchronizing state for tgt.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d tgt defaults
Executing /usr/sbin/update-rc.d tgt enable
Failed to execute operation: No such file or directory

tgt is now starting.

Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Some parts failing is bug 1447807, but perhaps tgt not starting by default is a separate bug, so leaving this open for now.

tags: added: systemd-boot
Changed in tgt (Ubuntu):
status: New → In Progress
assignee: nobody → ubuntudotcom1 (ubuntudotcom1)
Revision history for this message
ubuntudotcom1 (ubuntudotcom1) wrote :

Looks like lp:ubuntu/vivid/tgt might not be compiling with the SD_NOTIFY flag set, which enables system signals required by systemd services with Type=notify. It looks like the Debian packaging (at least version tgt_1.0.57-1.debian_) has it enabled. Also might need the sysmlink to tgt.service in /etc/systemd/system/tgt.service.

Built the package from source with the SD_NOTIFY flag and created the symlink. The service starts with the package's tgt.service.

Still looking into the startup problem tho. Seeing the same issue with systemctl enable tgt, so this needs more investigation.

Revision history for this message
ubuntudotcom1 (ubuntudotcom1) wrote :

Yeah it looks like compiling with the SD_NOTIFY feature flag enabled and installing the package's included tgt.service file to /lib/systemd/system/tgt.service fixes this. systemctl enable tgt will work without any issues and tgt starts up correctly on bootup. Suggest syncing packaging w/ upstream?

Revision history for this message
ubuntudotcom1 (ubuntudotcom1) wrote :

$ sudo service tgt status
● tgt.service - (i)SCSI target daemon
   Loaded: loaded (/lib/systemd/system/tgt.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2015-05-12 10:31:38 CDT; 8min ago
     Docs: man:tgtd(8)
  Process: 852 ExecStop=/usr/sbin/tgtadm --op delete --mode system (code=exited, status=0/SUCCESS)
  Process: 848 ExecStop=/usr/sbin/tgt-admin --update ALL -c /dev/null -f (code=exited, status=0/SUCCESS)
  Process: 846 ExecStop=/usr/sbin/tgt-admin --offline ALL (code=exited, status=0/SUCCESS)
  Process: 844 ExecStop=/usr/sbin/tgtadm --op update --mode sys --name State -v offline (code=exited, status=0/SUCCESS)
  Process: 870 ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v ready (code=exited, status=0/SUCCESS)
  Process: 865 ExecStartPost=/usr/sbin/tgt-admin -e -c /etc/tgt/targets.conf (code=exited, status=0/SUCCESS)
  Process: 863 ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v offline (code=exited, status=0/SUCCESS)
 Main PID: 862 (tgtd)
   Status: "Starting event loop..."
   CGroup: /system.slice/tgt.service
           └─862 /usr/sbin/tgtd -f

May 12 10:31:37 maas-vivid systemd[1]: Starting (i)SCSI target daemon...
May 12 10:31:37 maas-vivid tgtd[862]: tgtd: work_timer_start(150) use signal based scheduler
May 12 10:31:38 maas-vivid tgtd[862]: tgtd: bs_init(386) use signalfd notification
May 12 10:31:38 maas-vivid systemd[1]: Started (i)SCSI target daemon.

Changed in maas:
status: New → In Progress
assignee: nobody → Blake Rouse (blake-rouse)
importance: Undecided → Critical
milestone: none → 1.8.0
Changed in maas:
status: In Progress → Fix Committed
Changed in tgt (Ubuntu):
status: In Progress → Confirmed
assignee: ubuntudotcom1 (ubuntudotcom1) → nobody
Changed in maas:
status: Fix Committed → Fix Released
Mathew Hodson (mhodson)
Changed in tgt (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I was verifying this bug and while still failing (in a slightly different way) on wily.
It was working just fine with Xenial.

From rmadison
 tgt | 1:1.0.57-1ubuntu2 | wily | source, amd64, arm64, armhf, i386, powerpc, ppc64el
 tgt | 1:1.0.63-1ubuntu1 | xenial | source, amd64, arm64, armhf, i386, powerpc, ppc64el, s390x

I don't think we consider SRUing this into wily right now, so I'll just mark it as fix released.
Please feel free to nominate for wily and reopen on that one if you think an SRU is really needed.

Changed in tgt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.