Bug 208864

Summary: /var/db/iscsi has moved - /etc/rwtab needs updating
Product: [Fedora] Fedora Reporter: Mark McLoughlin <markmc>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mchristi, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.44-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-10-05 10:12:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mark McLoughlin 2006-10-02 14:01:01 UTC
See also #208548

What was in /var/db/iscsi is now in /etc/iscsi/send_targets and
/etc/iscsi/nodes. So, /etc/rwtab should contain:

  files /etc/iscsi/nodes
  files /etc/iscsi/send_targets

Would it not be more sane, though, for iscsi-initiator-utils itself to install a
file into rwtab.d? That way, if the location changes again, rwtab would be
updated  with the package

Comment 1 Mark McLoughlin 2006-10-02 14:02:13 UTC
For reference - here's Mike's reply to the original readonly-root audit:

Bill Nottingham wrote:
> As part of Stateless Linux, we've been examining packages that keep data
> in /var outside of well defined places such as /var/run or /var/lock.
> You're listed as the owner of iscsi-initiator-utils, which places data in:
>       /var/db/iscsi
> 
> What we'd like is a quick description of what this data is, and how
> and when it's written to. For example, does it fit one of the following
> classifications:
> 
> 1) Temporary run-time state (such as lock files)
> 2) Persistent run-time state (such as dhcp server leases)
> 3) Persistent data that doesn't necessarily need modified at runtime
>    (such as locate databases)
> 4) Persistent data that *does* need modified at runtime
> 5) Persistent data that would arguably moved elsewhere on a stateless
>    implementation (http server content)

Currently it is #4. It The info stored in /var/db/iscsi is the setup
info needed for iscsi connection to a specific target port.

A user typically performs iscsi discovery using the iscsiadm tool
whenever there is new storage in the iscsi network. At that time we
store the discovery info, such as discovery address and discovery type
in /var/db/iscsi DB and we also store the discovery results such as what
targets and their ports were found and other configuration info.

Later, a user or startup script can connect to the a target port found
during discovery by running something like "iscsiadm -record
this-is-the-/var/db/iscsi-record-number -login". At this time the DB
info is read and used to login.

A user may want to remove the connection info from the DB, if the target
port is removed or if there is some other storage reconfiguration event,
and can do this with a iscsiadm remove command. At that time we write to
/var/db/iscsi to remove that target info.

And at any time after discovery has been performed, the user can modify
the configuration info for any target port, and that requries a read and
write to the DB in /var/db/iscsi. They may want to do this to add iSCSI
CHAP info or override the defaults used.


Comment 2 Bill Nottingham 2006-10-02 14:50:58 UTC
I can change the stock one - that's not an issue. Why did it move to /etc, out
of curiousity?

Comment 4 Mike Christie 2006-10-02 16:04:07 UTC
(In reply to comment #2)
> I can change the stock one - that's not an issue. Why did it move to /etc, out
> of curiousity?

To sum up the threads from Mark.

We used to use db4-devel to store iscsi info in a db at /var/db/iscsi. When we
removed db4 usage and went to text files, it was thought that the iscsi target
info is similar to eth0 or scsi3 (NIC or SCSI HBA) config info, so I put it in
/etc/sysconfig. It turned out that people did not like sysconfig and most people
liked /etc/iscsi so I put it there (Some of the other files like lock and pid
got moved by accident due to a bulk cut and replace).

I do not care where it goes. And, I do not know the proper place to put it so I
rely on the pepole one the list to inform me when I mssed up some userspace
thing. So if /var is best we can move it. If it is a Red Hat reason though
please let me know, so I can change it upstream so SUSE and debain can change it
(gentoo agrees it should go in /var/run but only due to read only concerns).


Comment 5 Mark McLoughlin 2006-10-02 16:25:59 UTC
Tangent ...

(In reply to comment #2)
> I can change the stock one - that's not an issue.

What I'm saying is that if this was in a rwtab shipped by the iscsi package,
then we wouldn't have upgrade issues (i.e. rwtab out of sync with iscsi) when
changes like this happen

Dunno, I'm just suprised that so far we've gone with everything in the stock one
and no package specific ones

Comment 6 Bill Nottingham 2006-10-02 16:58:10 UTC
Well...

1) it seems more like run-time state, which would be more normally in /var
2) what happens with root-on-iscsi - is it just ignored?

Comment 7 Mike Christie 2006-10-02 18:08:27 UTC
(In reply to comment #6)
> Well...
> 
> 1) it seems more like run-time state, which would be more normally in /var
> 2) what happens with root-on-iscsi - is it just ignored?

For root-on-iscsi, I think we will want to be able to update the iscsi node info
(text files currently in /etc/iscsi). So all this means it should be in /var
right? Would it be /var/iscsi or /var/db/iscsi?

Comment 8 Bill Nottingham 2006-10-02 18:28:46 UTC
Per-boot would be /var/run/iscsi, if it's persistent, /var/lib/iscsi? Might need
to re-read what the FHS suggests.

Comment 9 Mike Christie 2006-10-02 20:28:15 UTC
In FHS 2.3, there is this for "/var/lib":

Users must never need to modify files in /var/lib to configure a package's
operation.

But the files in /etc/iscsi/nodes and send_targets are config files either our
tools create/modify or the user creates/modifies. Does this mean that it should
not be in /var/lib?

Comment 10 Bill Nottingham 2006-10-03 03:23:22 UTC
Probably not - is this a config file or run-time state? It seems to be both.

Comment 11 Mike Christie 2006-10-03 18:15:02 UTC
(In reply to comment #10)
> Probably not - is this a config file or run-time state? It seems to be both.

I think both and maybe it depends on how you see the system and tools. I am just
going to stick this in /var/lib then.

Comment 12 Bill Nottingham 2006-10-03 19:14:53 UTC
So, /var/lib/iscsi?

Comment 13 Mike Christie 2006-10-03 19:17:36 UTC
yeah that is fine with me.

Comment 14 Bill Nottingham 2006-10-03 19:20:24 UTC
OK, changed in cvs.

Comment 15 Mike Christie 2006-10-03 19:52:33 UTC
iscsi-initiator-utils changed in iscsi-initiator-utils-6.2.0.695-0.5. Thanks for
the bug report Mark and thanks for the help Bill.