• PROCESS_SPAWN_ weirdness

    From Randall@21:1/5 to All on Mon Feb 8 11:37:37 2021
    Hi All,

    I'm trying to use PROCESS_SPAWN_ from GUARDIAN. Normally there are no issues when I am setting stdout of the created child to a process name or SSH tty. However, when I specify an OSS path for stdout, whether the file exists or not, the file is appended
    to the cwd and the process fails being unable to open stdout, with either an error 4002 (no such file) if I don't pre-create the file, or 4021 (is a directory, which it's not) if I do.

    /* Build the fdinfo entry for stdout */
    fdentry[1].z_fd = 1;
    fdentry[1].z_dupfd = -1;
    fdentry[1].z_name = "/tmp/test.out";
    fdentry[1].z_oflag = O_WRONLY;
    fdentry[1].z_mode = 0755;

    The 4002 is reported on /home/randall//tmp/test.out. This one has me scratching my head. Any thoughts?

    TIA,
    Randall

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Keith Dick@21:1/5 to Randall on Mon Feb 8 16:38:36 2021
    On Monday, February 8, 2021 at 11:37:39 AM UTC-8, Randall wrote:
    Hi All,

    I'm trying to use PROCESS_SPAWN_ from GUARDIAN. Normally there are no issues when I am setting stdout of the created child to a process name or SSH tty. However, when I specify an OSS path for stdout, whether the file exists or not, the file is
    appended to the cwd and the process fails being unable to open stdout, with either an error 4002 (no such file) if I don't pre-create the file, or 4021 (is a directory, which it's not) if I do.

    /* Build the fdinfo entry for stdout */
    fdentry[1].z_fd = 1;
    fdentry[1].z_dupfd = -1;
    fdentry[1].z_name = "/tmp/test.out";
    fdentry[1].z_oflag = O_WRONLY;
    fdentry[1].z_mode = 0755;

    The 4002 is reported on /home/randall//tmp/test.out. This one has me scratching my head. Any thoughts?

    TIA,
    Randall

    I've no experience in this area, but I wonder whether the fact that the mode you are giving allows both read and write while the flag is write-only has anything to do with the problem.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JShepherd@21:1/5 to All on Tue Feb 9 16:46:35 2021
    In article <d924a3ba-d3a6-4ed7-ad30-74d17e662647n@googlegroups.com>, rsbecker@nexbridge.com says...

    Hi All,

    I'm trying to use PROCESS_SPAWN_ from GUARDIAN. Normally there are no issue= >s when I am setting stdout of the created child to a process name or SSH tt= >y. However, when I specify an OSS path for stdout, whether the file exists = >or not, the file is appended to the cwd and the process fails being unable = >to open stdout, with either an error 4002 (no such file) if I don't pre-cre= >ate the file, or 4021 (is a directory, which it's not) if I do.

    /* Build the fdinfo entry for stdout */
    fdentry[1].z_fd =3D 1;
    fdentry[1].z_dupfd =3D -1;
    fdentry[1].z_name =3D "/tmp/test.out";
    fdentry[1].z_oflag =3D O_WRONLY;
    fdentry[1].z_mode =3D 0755;

    The 4002 is reported on /home/randall//tmp/test.out. This one has me scratc= >hing my head. Any thoughts?

    TIA,
    Randall


    Never seen that happen but we don't set mode
    and we set access to read/write

    fd->z_fd = 1; /* stdout */
    fd->z_dupfd = -1; /* not a dup, must be opened */
    fd->z_name = (long)outfile;
    fd->z_oflag = ZSYS_VAL_OSSOPEN_RDWR;
    fd->z_mode = 0;
    fd++;
    fdinfo->z_fdcount++;

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JShepherd@21:1/5 to All on Tue Feb 9 17:00:58 2021
    In article <d924a3ba-d3a6-4ed7-ad30-74d17e662647n@googlegroups.com>, rsbecker@nexbridge.com says...

    Hi All,

    I'm trying to use PROCESS_SPAWN_ from GUARDIAN. Normally there are no issue= >s when I am setting stdout of the created child to a process name or SSH tt= >y. However, when I specify an OSS path for stdout, whether the file exists = >or not, the file is appended to the cwd and the process fails being unable = >to open stdout, with either an error 4002 (no such file) if I don't pre-cre= >ate the file, or 4021 (is a directory, which it's not) if I do.

    /* Build the fdinfo entry for stdout */
    fdentry[1].z_fd =3D 1;
    fdentry[1].z_dupfd =3D -1;
    fdentry[1].z_name =3D "/tmp/test.out";
    fdentry[1].z_oflag =3D O_WRONLY;
    fdentry[1].z_mode =3D 0755;

    The 4002 is reported on /home/randall//tmp/test.out. This one has me scratc= >hing my head. Any thoughts?

    TIA,
    Randall


    Maybe you have to OR in
    ZSYS_VAL_OSSOPEN_CREAT
    to z_flag

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Randall@21:1/5 to JShepherd on Tue Feb 9 13:46:30 2021
    On Tuesday, February 9, 2021 at 12:01:00 p.m. UTC-5, JShepherd wrote:
    In article <d924a3ba-d3a6-4ed7...@googlegroups.com>,
    rsbe...@nexbridge.com says...

    Hi All,

    I'm trying to use PROCESS_SPAWN_ from GUARDIAN. Normally there are no issue= >s when I am setting stdout of the created child to a process name or SSH tt= >y. However, when I specify an OSS path for stdout, whether the file exists = >or not, the file is appended to the cwd and the process fails being unable = >to open stdout, with either an error 4002 (no such file) if I don't pre-cre= >ate the file, or 4021 (is a directory, which it's not) if I do.

    /* Build the fdinfo entry for stdout */
    fdentry[1].z_fd =3D 1;
    fdentry[1].z_dupfd =3D -1;
    fdentry[1].z_name =3D "/tmp/test.out";
    fdentry[1].z_oflag =3D O_WRONLY;
    fdentry[1].z_mode =3D 0755;

    The 4002 is reported on /home/randall//tmp/test.out. This one has me scratc= >hing my head. Any thoughts?

    TIA,
    Randall
    Maybe you have to OR in
    ZSYS_VAL_OSSOPEN_CREAT
    to z_flag

    It was O_CREAT from fdentry[1].z_oflag that I was missing and did the trick.

    The stdout descriptor should not be opened for read, normally. That causes all kinds
    of issues when interacting with OSS processes like Jenkins.

    The appended file name was an artifact of reporting failure, not the cause. Whew.

    Thanks for the help.
    Randall

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)