On 29-Oct-2013 14:33 -0700, Mr. K.V.B.L. wrote:
> I know that if one checks CHGIPLA you can see if TCP is started at
> IPL (STRTCP(*YES)).
That shows if the IPL attribute will effect STRTCP at\near the
completion of the OS IPL processing. From older releases, the
implication of that IPL Attr setting is that the "STRTCP command is
automatically submitted at the completion of IPL"; actually or
effectively /submitted/ is, as I recall, dependent upon release. For
example, I think since v6r1 the request was effected in the QSYSARB5 [or
some other QSYSARB#] system job; thus /activated/ in a system job, but
not effected by an actual "Submit Job (SBMJOB)" request, as one might
infer from that text.
In v7r1 the docs suggest the "Start TCP/IP (STRTCP)" parameter
"Specifies whether the Start TCP/IP (STRTCP) command is automatically
submitted at the completion of IPL and when the controlling subsystem is
restarted to bring the system out of the restricted state. The STRTCP
command is not submitted during install IPLs or when the system is
starting to the restricted state."
> 1. When exactly is TCP started? Before or after the QSTRUP program
> has started?
The final step in the OS IPL is effectively, starting (STRSBS) of the
controlling subsystem (QCTLSBSD system value); i.e. the final action for
which the OS IPL transfers control to the user-defined continuation of
the IPL [auto-start and start-up activity]. Preceding the start of the
controlling subsystem, is the start of all /system jobs/ of which one
will be the QSYSARB# job; a job that may, according to the STRTCP IPL
Attribute, Start the TCP/IP interfaces and servers. From the above
quoted v7r1 CHGIPLA command help text, they should be considered to be
started concurrently, because although they may be started serially,
each start request [the autostart job entry QSTRUPJD in the controlling
subsystem and the STRTCP command] will runs asynchronous to their
original method of activation that were likely performed serially.
> I want to start a group of TCP socket servers in the startup program,
> but when I do they all fail for a certain amount of time with the
> following error message:
>
> "The TCP/IP routine accept() failed because of The protocol required
> to support the specified address family is not available at this
> time."
I expect that defining and using a user-defined TCP/IP server with
the AutoStart attribute set to *YES might be a better approach? Look at
the Add TCP/IP Server (ADDTCPSVR) command.
Or possibly... Just test\poll an "interface status" [i.e. ensuring
"Active - The interface has been started and is running."] or test\poll
the pre-requisite "stack status" [i.e. ensuring either "Active - The
TCP/IPv4 stack is operational." or "Active - The TCP/IPv4 stack is
operational."] before trying to start the socket servers that require
the protocol having been established.?
> I'm reading through old posts about STRTCP and it seems that TCP is
> reliant on the subsystem QSERVER being fully functional.
Not sure where that was implied, but that seems amiss. AFaIK, the
QSYSWRK *SBSD would be the more likely to have TCP/IP server jobs; e.g.
from older releases anyhow, the QTCPIP and QTCPMONITR type-BCH jobs, and
various other jobs running\started with user QTCP.
> That is fine, I just need to know when to start my jobs to avoid
> these log file messages. The log file grows to a huge size while
> this TCP/QSERVER initialization is taking place.
Not sure about the origin for the log file growth, but from that
description I infer perhaps the code just loops repeatedly without any
delay to retry the failure? That would mean tempering the retry by
coding a timed-wait could reduce the errors being logged?
Regardless... Back to the "when to start"... Perhaps like I alluded
earlier, to offloading the start to the STRTCP itself, irrespective the
initiation being effected by STRTCP [e.g. in the QSTRUPPGM] or effected
via the IPL attribute the CHGIPLA. Or if that does not make sense, then
perhaps polling for an /active/ status of the pre-requisite function,
either within the StartUp program or within the jobs that are the
/socket servers/ that are activated by the startup program.
--
Regards, Chuck