Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1880297

Summary: targetcli daemon crashes in batch mode
Product: Red Hat Enterprise Linux 7 Reporter: Prasanna Kumar Kalever <prasanna.kalever>
Component: targetcliAssignee: Maurizio Lombardi <mlombard>
Status: CLOSED CURRENTRELEASE QA Contact: Filip Suba <fsuba>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.9CC: fsuba, revers, sostapov
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-18 16:22:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1797914    

Description Prasanna Kumar Kalever 2020-09-18 08:56:51 UTC
Description of problem:

Tragtcli dameon is crashing with  below trace:


[root@dhcp53-152 ~]# targetcli << EOF
> /iscsi create iqn.2016-12.org.gluster-block:2de49b7e-4ecd-4d52-ae22-603923691a7c
> exit
> EOF
targetcli shell version 2.1.51
Entering targetcli batch mode for daemonized approach.
Enter multiple commands separated by newline and type 'exit' to run them all in one go.

/> Traceback (most recent call last):
  File "/usr/bin/targetcli", line 332, in <module>
    main()
  File "/usr/bin/targetcli", line 288, in main
    switch_to_daemon(shell, interactive_mode)
  File "/usr/bin/targetcli", line 228, in switch_to_daemon
    pos = shell.con.get_cursor_xy()
  File "/usr/lib/python2.7/site-packages/configshell_fb/console.py", line 122, in get_cursor_xy
    coords = [int(coord) for coord in self.escape("6n", "R")]
  File "/usr/lib/python2.7/site-packages/configshell_fb/console.py", line 86, in escape
    attributes = tcgetattr(self._stdin)
termios.error: (25, 'Inappropriate ioctl for device')
[root@dhcp53-152 ~]# 



Version-Release number of selected component (if applicable):
targetcli: 2.1.51-2.el7

How reproducible:
100%

Steps to Reproduce:
1. start the dameon
2. activate the daemon mode
3. use batch mode
4. Run:
$ targetcli << EOF
ls
EOF

Actual results:
Crash

Expected results:
No Crash

Additional info:

Comment 2 Maurizio Lombardi 2020-11-18 16:22:54 UTC
This bug was due to an ad-hoc patch for targetcli/RHEL7 that I deleted when
I rebased the package for the latest 7.9.z release.

I close this bz.