Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 501996 - sys-block/open-iscsi-2.0.873 - /etc/init.d/iscsid should wait longer for pid file creation
Summary: sys-block/open-iscsi-2.0.873 - /etc/init.d/iscsid should wait longer for pid ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-21 14:18 UTC by Krzysztof
Modified: 2015-08-08 05:42 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof 2014-02-21 14:18:42 UTC
elo,
It is not always reproducible, but in virtualized environment under heavy load you can see at system startup:  *start-stop-daemon: did not create a valid pid in `/var/run/iscsid.pid`.

Usually this helps (file located in /etc/init.d):

finlandia-xen working # diff -Naur iscsid iscsid.old
--- iscsid      2014-02-21 13:30:43.000000000 +0100
+++ iscsid.old  2014-02-21 14:50:53.303125000 +0100
@@ -5,7 +5,7 @@

 command="/usr/sbin/iscsid"
 command_args="${OPTS}"
-start_stop_daemon_args="-w 10" # iscsid might fail e.g. when the iSCSI kernel modules aren't available
+start_stop_daemon_args="-w 100" # iscsid might fail e.g. when the iSCSI kernel modules aren't available
 pidfile=${PIDFILE:-/var/run/${SVCNAME}.pid}

 extra_started_commands="starttargets stoptargets"

Reporting this just to help someone in search for this particular problem.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-02-21 14:22:50 UTC
Why does it wait at all? Timeouts are inherently broken in this case.
Comment 2 Krzysztof 2014-03-02 21:24:52 UTC
(In reply to Jeroen Roovers from comment #1)
> Why does it wait at all? Timeouts are inherently broken in this case.

Yup, we are trying to boot faster and faster... so yes they are :)

I am using open-iscsi-2.0.873 because previous ebuild open-iscsi-2.0.872-r2 insisted that some kernel parts should be modules (and I want monolithic one), namely:
Open-iscsi will not start when iSCSI Initiator over TCP/IP is built-in, so you have to make it a module for now.
Open-iscsi will not start when iSCSI Transport Attributes is built-in, so you have to make it a module for now.
(see: http://etherboot.org/wiki/sanboot/gentoo_iscsi)

I'm using Linux/x86_64 3.7.0-hardened and these are CONFIG_ISCSI_TCP & CONFIG_SCSI_ISCSI_ATTRS.

open-iscsi-2.0.873 doesn't try to load modules so I can cleanly startup and shutdown my machine.
Comment 3 Sebastian 2014-04-27 09:49:45 UTC
I ran into the same issue once I upgraded to 2.0.873. With the default wait time I get:

Apr 27 11:00:46 94123 iscsid: iSCSI logger with pid=1197 started!
Apr 27 11:00:46 94123 /etc/init.d/iscsid[1193]: start-stop-daemon: did not create a valid pid in `/var/run/iscsid.pid'
Apr 27 11:00:46 94123 /etc/init.d/iscsid[1181]: ERROR: iscsid failed to start
Apr 27 11:00:46 94123 kernel: Loading iSCSI transport class v2.0-870.
Apr 27 11:00:46 94123 wpa_cli: interface wlp4s0 CONNECTED
Apr 27 11:00:47 94123 kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Apr 27 11:00:47 94123 kernel: nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
Apr 27 11:00:47 94123 iscsid: iSCSI daemon with pid=1198 started!

So a race occurs which start-stop-daemon wins. Maybe the computer is just too slow :-)

When increasing the wait time to 0.1 seconds as suggested by Krzysztof, the problem disappears:

Apr 27 11:24:38 94123 iscsid: iSCSI logger with pid=1222 started!
Apr 27 11:24:38 94123 kernel: Loading iSCSI transport class v2.0-870.
Apr 27 11:24:38 94123 kernel: ip_tables: (C) 2000-2006 Netfilter Core Team
Apr 27 11:24:38 94123 kernel: nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
Apr 27 11:24:39 94123 iscsid: iSCSI daemon with pid=1223 started!
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-08-08 05:42:29 UTC
fixed in 2.0.873