PU under linux? :)

Product: PowerShell Universal
Version: 1.5.2
OS: Centos 8
Powershell: 7.1
aspnetcore-runtime: 5.0
dotnet-runtime: 5.0

it seems the guide are a little short :wink:

I get the following:

[root@server Universal]# ./Universal.Server
2020-11-22 10:39:02 [INFO] (Hangfire.BackgroundJobServer) Starting Hangfire Server using job storage: ‘Hangfire.MemoryStorage.MemoryStorage’
2020-11-22 10:39:02 [INFO] (Hangfire.BackgroundJobServer) Using the following options for Hangfire Server:
Worker count: 5
Listening queues: ‘default’
Shutdown timeout: 00:00:15
Schedule polling interval: 00:00:15
2020-11-22 10:39:03 [INFO] (Hangfire.Server.BackgroundServerProcess) Server server:5804:5a6dc04a successfully announced in 170.0503 ms
2020-11-22 10:39:03 [INFO] (Hangfire.Server.BackgroundServerProcess) Server server:5804:5a6dc04a is starting the registered dispatchers: ServerWatchdog, ServerJobCancellationWatcher, ExpirationManager, CountersAggregator, Worker, DelayedJobScheduler, RecurringJobScheduler…
2020-11-22 10:39:03 [INFO] (Hangfire.Server.BackgroundServerProcess) Server server:5804:5a6dc04a all the dispatchers started
Segmentation fault

im not sure how to get anymore logs? :slight_smile:
it have created the .PowerShellUniversal folder and .aspnet folder fine, with

the log file contain:

2020-11-22T22:34:03.6468098+00:00 [INF] User profile is available. Using ‘"/root/.aspnet/DataProtection-Keys"’ as key repository; keys will not be encrypted at rest. (a162847e)
2020-11-22T22:34:03.8127343+00:00 [INF] Creating key {dbcac743-2c67-4563-b5c1-683bdee05a20} with creation date 2020-11-22 22:34:03Z, activation date 2020-11-22 22:34:03Z, and expiration date 2021-02-20 22:34:03Z. (77afce94)
2020-11-22T22:34:03.8408044+00:00 [WRN] No XML encryptor configured. Key {dbcac743-2c67-4563-b5c1-683bdee05a20} may be persisted to storage in unencrypted form. (9ca7e61e)
2020-11-22T22:34:03.8433838+00:00 [INF] Writing data to file ‘"/root/.aspnet/DataProtection-Keys/key-dbcac743-2c67-4563-b5c1-683bdee05a20.xml"’. (da22a8b1)
2020-11-22T22:39:02.7579266+00:00 [INF] User profile is available. Using ‘"/root/.aspnet/DataProtection-Keys"’ as key repository; keys will not be encrypted at rest. (a162847e)

What distro are you using? Based on the Segmentation fault, it seems like it’s crashing. I don’t know if the docker file will be helpful but we are pretty much downloading the ZIP, extracting it and starting the server for our image on Docker Hub.

Image Layer Details - ironmansoftware/universal:latest - sha256:5e9f0fa9d0a19625f13cd1f46434e5a65b335c2ba6b755d885eccea7f4a696ea - Docker Hub

The OS is CentOs 8, running in a LXD container.

Could you share the dockerfile?

Sure. Here you go:

# Docker image file that describes an Ubuntu18.04 image with PowerShell installed from Microsoft APT Repo
ARG fromTag=lts-ubuntu-18.04
ARG imageRepo=mcr.microsoft.com/powershell
FROM ${imageRepo}:${fromTag} AS installer-env

ARG PACKAGE_URL=https://imsreleases.blob.core.windows.net/universal/production/${VERSION}/Universal.linux-x64.${VERSION}.zip
ARG DEBIAN_FRONTEND=noninteractive 

# Install dependencies and clean up
RUN apt-get update \
    && apt-get install -y apt-utils 2>&1 | grep -v "debconf: delaying package configuration, since apt-utils is not installed" \
    && apt-get install --no-install-recommends -y \
    # curl is required to grab the Linux package
        curl \
    # less is required for help in powershell
        less \
    # requied to setup the locale
        locales \
    # required for SSL
        ca-certificates \
        gss-ntlmssp \
    # PowerShell remoting over SSH dependencies
        openssh-client \
        unzip \
    # Download the Linux package and save it
    && echo ${PACKAGE_URL} \
    && curl -sSL ${PACKAGE_URL} -o /tmp/universal.zip \
    && unzip /tmp/universal.zip -d ./home/Universal || : \
    # remove powershell package
    && rm /tmp/universal.zip \
    && chmod +x ./home/Universal/Universal.Server

# Use PowerShell as the default shell
# Use array to avoid Docker prepending /bin/sh -c
ENTRYPOINT ["./home/Universal/Universal.Server"]

Thanks Adam.
That works.

I will see what is up with the LXD, maybe I am missing some of the stuff you add :slight_smile: