Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 565824 - sys-block/lio-utils - improper mode on required utility scripts
Summary: sys-block/lio-utils - improper mode on required utility scripts
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords: PMASKED
: 562284 585128 (view as bug list)
Depends on:
Blocks: 609674
  Show dependency tree
 
Reported: 2015-11-15 09:01 UTC by James Lavoy
Modified: 2017-04-07 08:24 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lio ebuild (lio-utils-4.0.ebuild,3.36 KB, text/plain)
2017-04-07 08:24 UTC, Giuseppe Vitillaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Lavoy 2015-11-15 09:01:57 UTC
lio-utils unpacks the following files which are used in dumping the targetcli/lio configurations to the disk:

>>> /usr/lib64/python2.7/site-packages/tcm_loop.py
>>> /usr/lib64/python2.7/site-packages/tcm_ramdisk.py
>>> /usr/lib64/python2.7/site-packages/tcm_pscsi.py
>>> /usr/lib64/python2.7/site-packages/tcm_iblock.py
>>> /usr/lib64/python2.7/site-packages/tcm_fileio.py
>>> /usr/lib64/python2.7/site-packages/tcm-4.1-py2.7.egg-info
>>> /usr/lib64/python2.7/site-packages/lio-4.1-py2.7.egg-info
>>> /usr/lib64/python2.7/site-packages/lio_dump.py
>>> /usr/lib64/python2.7/site-packages/lio_node.py
>>> /usr/lib64/python2.7/site-packages/tcm_dump.py
>>> /usr/lib64/python2.7/site-packages/tcm_node.py
>>> /usr/lib64/python2.7/site-packages/tcm_fabric.py

These files are not set to executable which causes saving the config to fail with permission denied:

/> saveconfig
WARNING: Saving abrams current configuration to disk will overwrite your boot settings.
The current target configuration will become the default boot config.
Are you sure? Type 'yes': yes
Making backup of loopback/ConfigFS with timestamp: 2015-11-15_02:55:00.149128
Traceback (most recent call last):
  File "/usr/sbin/tcm_fabric", line 141, in <module>
    os.execv(target_executable_path, sys.argv)
OSError: [Errno 13] Permission denied
Successfully updated default config /etc/target/loopback_start.sh
Making backup of LIO-Target/ConfigFS with timestamp: 2015-11-15_02:55:00.149128
Traceback (most recent call last):
  File "/usr/sbin/lio_dump", line 142, in <module>
    os.execv(target_executable_path, sys.argv)
OSError: [Errno 13] Permission denied
Generated LIO-Target config: /etc/target/backup/lio_backup-2015-11-15_02:55:00.149128.sh
Making backup of Target_Core_Mod/ConfigFS with timestamp: 2015-11-15_02:55:00.149128
Traceback (most recent call last):
  File "/usr/sbin/tcm_dump", line 141, in <module>
    os.execv(target_executable_path, sys.argv)
OSError: [Errno 13] Permission denied
Generated Target_Core_Mod config: /etc/target/backup/tcm_backup-2015-11-15_02:55:00.149128.sh
Successfully updated default config /etc/target/lio_start.sh
Successfully updated default config /etc/target/tcm_start.sh


This is corrected by setting them as executable:

abrams ~ # while read file; do chmod -v 700 $file; done < broken
mode of ‘/usr/lib64/python2.7/site-packages/tcm_loop.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm_ramdisk.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm_pscsi.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm_iblock.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm_fileio.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm-4.1-py2.7.egg-info’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/lio-4.1-py2.7.egg-info’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/lio_dump.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/lio_node.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm_dump.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm_node.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
mode of ‘/usr/lib64/python2.7/site-packages/tcm_fabric.py’ changed from 0644 (rw-r--r--) to 0700 (rwx------)
abrams ~ # targetcli
stargetcli GIT_VERSION (rtslib GIT_VERSION)
Copyright (c) 2011-2013 by Datera, Inc.
All rights reserved.
/> saveconfig
WARNING: Saving abrams current configuration to disk will overwrite your boot settings.
The current target configuration will become the default boot config.
Are you sure? Type 'yes': yes
Making backup of loopback/ConfigFS with timestamp: 2015-11-15_02:56:01.397348
Successfully updated default config /etc/target/loopback_start.sh
Making backup of LIO-Target/ConfigFS with timestamp: 2015-11-15_02:56:01.397348
Generated LIO-Target config: /etc/target/backup/lio_backup-2015-11-15_02:56:01.397348.sh
Making backup of Target_Core_Mod/ConfigFS with timestamp: 2015-11-15_02:56:01.397348
Generated Target_Core_Mod config: /etc/target/backup/tcm_backup-2015-11-15_02:56:01.397348.sh
Successfully updated default config /etc/target/lio_start.sh
Successfully updated default config /etc/target/tcm_start.sh
/> exit
Comment 1 Edoardo Liverani 2016-04-04 16:03:10 UTC
Same problem here.
Take note that it also affects the init scripts...

# /etc/init.d/target restart
 * Unload Linux-iSCSI.org Fabric module ...
Traceback (most recent call last):
  File "/usr/sbin/lio_node", line 141, in <module>
    os.execv(target_executable_path, sys.argv)
PermissionError: [Errno 13] Permission denied                                                                                                                          [ !! ]
 * Unloading misc fabric modules:  ...
Successfully released fabric: /sys/kernel/config/target/loopback                                                                                                       [ ok ]
 * Unloading Target Core modules:  ...
Traceback (most recent call last):
  File "/usr/sbin/tcm_node", line 141, in <module>
    os.execv(target_executable_path, sys.argv)
PermissionError: [Errno 13] Permission denied                                                                                                                          [ !! ]
 * ERROR: target failed to stop
Comment 2 James Lavoy 2016-04-04 16:16:48 UTC
Bumping the priority since this has been broken for 5 months. Apologies if this is inappropriate.
Comment 3 Andrew Savchenko gentoo-dev 2016-04-06 09:00:58 UTC
*** Bug 562284 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Savchenko gentoo-dev 2016-04-06 09:02:00 UTC
Same problem here, will look at it when have some time.
Comment 5 REdOG 2016-06-15 18:36:52 UTC
May not be optimal but since this is the 6th time I've had to fix this, it can be remedied by fixing the permissions:

qlist lio-utils | grep .py$ | xargs chmod u+x
Comment 6 Sergey Popov (RETIRED) gentoo-dev 2016-07-29 10:36:02 UTC
*** Bug 585128 has been marked as a duplicate of this bug. ***
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-02-17 20:20:48 UTC
Same as rtsadmin -- live ebuild committed in 2012, no activity since then. Plus it's broken. Sounds like we should kill it with fire.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-02-17 20:39:53 UTC
# Michał Górny <mgorny@gentoo.org> (17 Feb 2017)
# Live ebuilds only. Committed in 2012 with no maintenance afterwards.
# One of the last packages to block distutils.eclass removal, #599838
# and #599840. Furthermore, lio-utils is broken, #565824. Removal
# in 30 days.
sys-block/lio-utils
sys-block/rtsadmin
Comment 9 Giuseppe Vitillaro 2017-03-06 16:56:39 UTC
I'm wondering how to start Linux LIO SCSI target WITHOUT lio-utils.

It is the package which installs /etc/init.d/target, the init script
needed to restart the iSCSI configuration saved from "targetcli"

The packages:

sys-block/targetcli
dev-python/rtslib
dev-python/configshell

just configure the LIO Linux iSCSI target in the kernel, but
the lio-utils are needed to start,restart and stop the configuration.

Beside that, this simple patch to the lio-utils ebuild:

        chmod +x "${D}${sitedir}"/tcm_fileio.py
        chmod +x "${D}${sitedir}"/tcm_iblock.py
        chmod +x "${D}${sitedir}"/tcm_loop.py
        chmod +x "${D}${sitedir}"/tcm_pscsi.py
        chmod +x "${D}${sitedir}"/tcm_ramdisk.py

allow the lio-utils to work under the current stable version of gentoo
(tested on my systems).

Removal of the package sys-block/lio-utils would make Linux LIO SCSI target unusable under gentoo, beside being present in the kernel.

Alternatives?
Comment 10 James Lavoy 2017-03-06 17:05:20 UTC
I'm not aware of any alternative. That's how I ran into this problem. I would think someone just needs to volunteer to take over maintaining this?
Comment 11 Edoardo Liverani 2017-03-06 17:23:35 UTC
>I would think someone just needs to volunteer to take over maintaining this?

I have never been a maintainer, but I have a slight knowledge on how ebuilds and portage works. I can volunteer as maintainer with some mentoring or initial help. It seems that it's not so hard and time consuming this kind of ebuild. Maybe I'm wrong. Feel free to contact me if you think it's appropriate.
I'm sorry we don't use this package anymore (switched to samba for data sharing) but it's a kind of thing I'd like to work on.
Comment 12 James Lavoy 2017-03-06 17:25:26 UTC
Since Open-ISCSI doesn't build against modern kernels anymore (or at least last I checked) this is the only ISCSI option still available for Gentoo. So we really shouldn't be sunsetting the package.
Comment 13 Kash Pande 2017-03-08 04:55:36 UTC
I rely on tcm_node and lio_node binaries which are provided by this package (and it is not broken here)
Comment 14 jonys 2017-03-08 09:52:35 UTC
There is an alternative iSCSI target – sys-block/tgt. I switched to it recently, because it is easier to configure, doesn't crash on memory-constrained systems and seems to be maintained more actively.
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-03-18 07:42:25 UTC
commit 0ad71ddba2d6828dd3ea41609642b5d4c6ede2a2
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: Thu Mar 16 20:26:42 2017
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: Sat Mar 18 08:33:26 2017

    sys-block/lio-utils: Remove last-rited pkg, #565824


Bug #453274 for potentially reintroducing it.
Comment 16 toon 2017-03-18 11:56:33 UTC
For completeness sake I would like to add that there is a direct successor of the suite targetcli/lio-utils/rtslib in the portage tree.  It is called targetcli-fb.  It is actively maintained upstream and has a simpler architecture than the targetcli package.  I'm using it in gentoo for quite some time now, to full satisfaction.  Targetcli-fb is the default iSCSI target package in RHEL 7.
Comment 17 Giuseppe Vitillaro 2017-04-07 08:24:26 UTC
Created attachment 469382 [details]
lio ebuild

If I understood correctly, lio gentoo ebuild is gone because the python distutils eclass is gone.

So, I wrote a quick, dirty and rough sketch of a new lio ebuild, using the new distutils-r1 eclass, which seems to install correctly on my amd64/stable gentoo systems, from my local portage overlays. It is a little bit different from the original ebuild (it hasn't wrappers), but targetcli seems to work correctly on my systems.

I understand there are alternatives to targetcli/lio, but anyway, targetcli it is a really nice way to configure Linux kernel iSCSI.

If anyone is interested, the ebuild sketch is attached to this post.

G. Vitillaro.