perldockernano-server

Perl system() does not wait in nano server


I am trying to run a Perl script in a docker container based on Windows 2016 Nano Server. For that I am using ActivePerl 5.24.

Now I ran into an interesting issue where the system() call behaves differently on my 2016 Server host and in the 2016 Nano Server container.

#!/usr/bin/perl

use strict;
use warnings;

my $status = system('perl.exe -c test.plx');
print "Return: " . $status . "\n";
print "Exit: " . ($status >> 8) . "\n";
print "Signal: " . ($status & 127) . "\n";
print "Message: $!\n";

On the host Windows 2016 Server it works as expected:

c:\>perl test.plx
test.plx syntax OK
Return: 0
Exit: 0
Signal: 0
Message:

On the Nano server in my Docker container it looks like this:

C:\>perl test.plx
Return: 768
Exit: 3
Signal: 0
Message:

So as you can see the output is missing and the return code is not 0.

If I now press return..

C:\>
C:\>test.plx syntax OK

So it looks like system() is not waiting and returns 768 (whatever that means)

I also tried with "ping -v" instead of "perl -c" but the same thing happens, so it must be something connected to the system() implementation.

Does anyone know why the same call behaves completely different in the docker container and what I could do to make system() wait?

Update: I confirmed that it works when I use microsoft/windowsservercore as the base image. So whatever happens here seems to be specific to the Nano Server.


Solution

  • I got a response from the ActiveState support regarding this issue.

    The standard ActiveState builds are not supported on Nano servers. There are too many missing components with Nano. If you were interested in pursuing a custom build I could connect you with our sales team, and they could describe our Enterprise tier offering.

    So it seems if I want to stick with Nano server I either have to wait until someone decides to implement it into the standard build, or I need to switch to a different Perl distribution.

    Until then I will use Server Core which works.