How to provide passwords to startjobmanager if started from a script?

Dear community,
I intend to install mathworks via ansible on a Debian machine and get an error concerning the password entry. The method I applied for R2022b does not work for R2023b.
The behavior can be reproduced, as illustrated:
huth@delphi:~$ /usr/local/mathworks/v2023b/toolbox/parallel/bin/startjobmanager
*** Set Parallel Computing Password ***
You have set user 'admin' to be the administrator for jobmanager
default_jobmanager on host delphi.energietechnik.tu-berlin.de. To enable this
account, create a password for user 'admin'.
Password:
Confirm the password:
huth@delphi:~$ /usr/local/mathworks/v2023b/toolbox/parallel/bin/stopjobmanager -clean
huth@delphi:~$ echo -e 's3cr3t\ns3cr3t' | /usr/local/mathworks/v2023b/toolbox/parallel/bin/startjobmanager
*** Set Parallel Computing Password ***
You have set user 'admin' to be the administrator for jobmanager
default_jobmanager on host delphi.energietechnik.tu-berlin.de. To enable this
account, create a password for user 'admin'.
Registering the admin user for job manager on host delphi.energietechnik.tu-berlin.de:27352 failed.
The admin user will not be available in this job manager.
Restart the job manager to register the admin user.
The cause of the problem is:
============================================================================
Operation aborted because no credentials were entered for user admin.
============================================================================
huth@delphi:~$
Best regards,
Frank Huth

 Réponse acceptée

You can use a tool like expect to automate the entry of credentials. For example, create a file named startjobmanager.exp with the following contents
#!/usr/bin/expect
spawn /usr/local/mathworks/v2023b/toolbox/parallel/bin/startjobmanager
expect "Password: \r"
send -- "s3cr3t\r"
expect "Confirm the password: \r"
send -- "s3cr3t\r"
expect eof
and make it executable
$ chmod +x startjobmanager.exp
You can then run
$ ./startjobmanager.exp
and the job manager should start (non-interactively) with the admin password set to s3cr3t.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Produits

Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by