dun / munge

MUNGE (MUNGE Uid 'N' Gid Emporium) is an authentication service for creating and validating user credentials.
GNU Lesser General Public License v3.0
250 stars 46 forks source link

Building Munge on WSL2/Ubuntu fails... #111

Closed wm2015email closed 2 years ago

wm2015email commented 2 years ago

Building Munge for WSL2/Ubuntu fails...

PS> wsl --install -d ubuntu 

Then from WSL, here's my Install script called install.sh:

#/bin/bash
set -o verbose
set -o errexit
sudo apt-get install build-essential -y
sudo apt-get install libssl-dev -y
tar xJf munge-0.5.14.tar.xz
cd munge-0.5.14
./configure                  \
    --prefix=/usr            \
    --sysconfdir=/etc        \
    --localstatedir=/var     \
    --runstatedir=/run
make
make check
sudo make install

I type:

$ ./install.sh

Here's some of the build script output:

PASS: 0001-env-vars.t 1 - MUNGE_BUILD_DIR directory exists
PASS: 0001-env-vars.t 2 - MUNGE_SOURCE_DIR directory exists
PASS: 0002-smiple.t 1 - expr string match of absolute path with "/" regex
PASS: 0002-smiple.t 2 - expr string match of absolute path with "\/" regex
PASS: 0002-smiple.t 3 - expr string match of long opt
PASS: 0002-smiple.t 4 - expr string match of long opt w/ preceding "--" parm
PASS: 0002-smiple.t 5 - expr string match of long opt w/ prepended "X" char
PASS: 0010-basic.t 1 - setup environment
PASS: 0010-basic.t 2 - create key
PASS: 0010-basic.t 3 - check keyfile creation
FAIL: 0010-basic.t 4 - start munged
FAIL: 0010-basic.t 5 - check pidfile creation
FAIL: 0010-basic.t 6 - check process is running
FAIL: 0010-basic.t 7 - check socket creation
...
dun commented 2 years ago

From the test suite output above, munged is failing to start. The subsequent tests fail because munged is not running. I'd recommend running 0010-basic.t directly to diagnose the problem:

t/0010-basic.t --root=/tmp/munge-test-$$ --verbose

Test suite tips & troubleshooting can be found here: https://github.com/dun/munge/wiki/Test-Suite

wm2015email commented 2 years ago

Actually, I decided not to compile it and use code below to run it instead... seems like munged needs some systemd things running that WSL doesn't start by defaul...

#=====================================================
# WSL2 SLURM Installation
#=====================================================

$ sudo apt install slurm-wlm
$ sudo apt install slurm-wlm-doc 

$ cp /usr/share/doc/slurm-wlm- 
        doc/html/configurator.easy.h/mnt/c/Users/$(whoami)/Desktop

#Open configurator.easy.html on Desktop in Web-brower and make these changes:

# Modifications to configurator.easy.html
ControlMachine    = z1
ProctrackType     = proctrack/pgid
StateSaveLocation = /var/spool/slurm-llnl
SlurmctldLogFile  = /var/log/slurm-llnl/Slurmctld.log
SlurmdLogFile     = /var/log/slurm-llnl/Slurmd.log

NodeName=z1 CPUs=8 RealMemory=6918 Sockets=1 CoresPerSocket=4 ThreadsPerCore=2 State=UNKNOWN
        PartitionName=debug Nodes=z1 Default=YES MaxTime=INFINITE State=UP

# Click Submit, and cut and paste resulting file into following vi session.
$ sudo vi /etc/slurm-llnl/slurm.conf

$ sudo mkdir -p /var/spool/slurm-llnl
$ sudo chown -R slurm:slurm /var/spool/slurm-llnl

#=====================================================
# WSL Start Servers
#=====================================================

#------------------
# Terminal 1
#------------------
# Run munge Daemon
$ sudo mkdir -p /var/run/munge    # gets erased everytime you shutdown wsl?
$ sudo chown -R munge:munge /var/run/munge
$ sudo -u munge /usr/sbin/munged  --syslog --force

# Sart Slurm Controller Daemon
$ sudo -u slurm slurmctld-wlm -D

#------------------
# Terminal 2
#------------------

# Start Slurm Daemon
$ sudo slurmd-wlm -D

#=====================================================
# SLURM IS READY FOR USE
#=====================================================

#------------------
# Terminal 3
#------------------

# Try a Job
dun commented 2 years ago

Well, munged doesn't require systemd; that's just the common way to start services on most Linux distros these days.

It looks like you've got things working, right?