andresgongora/synth-shell

[Windows] Errors on Start-up

adedaporh opened this issue · 11 comments

Error on start-up
I get a "Failed to connect to bus: No such file or directory error"
To Reproduce
Steps to reproduce the behavior:

  1. Follow the set up process on Code page
  2. Launch Ubuntu shell on WSL 2

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Additional context
Add any other context about the problem here, like your opinion on the problem or any other clue that might be helpful.

That's the bad thing with bash, error messages are awful. Can you edit your config (probably) under ~/.config/synth-shell/synth-shell-greeter.conf and remove all load bars from the variable print_info. Just remove all lines ended in _MON. The error should probably go away, then add them one by one until we pinpoint the culprit. Sorry for the hassle.

Oh, you didn't mention. Are you running on Windows?

Yes. I'm running on Windows 10 and WSL 2

it might be an error with the update to ~/.bashrc

I have no way to test/debug the script on Windows, but I'll try to fix it if you help me out and do the tests for me :)

Usually, when other users have gotten the -bash [: error it was because:

  1. I was mixing shell and bash code
  2. Some of the monitors were broken. Where every element that is printed out next to the Logo is a monitor, like the amount of available RAM and CPU load.

I'm not sure what happens on windows, but you should somewhere have a synth-shell-greeter.config file that you can edit to enable/customize the monitors and logo. If you locate that file, you'll see that it contains a parameter called print_info. Try to remove all monitors (ended in _MON) from it an open a new terminal. You should see the logo and some info only. Let me know if that fixes the problem. One we know that we can narrow down the possible causes ;)

@andresgongora, Errors related to systemctl calls:

+++++ printInfoSystemctl
++++++ systemctl --failed
++++++ grep --color=auto 'loaded units listed'
++++++ head -c 1
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
+++++ local systcl_num_failed=
+++++ '[' '' -eq 0 ']'
-bash: [: : integer expression expected
+++++ '[' '' -eq 1 ']'
-bash: [: : integer expression expected

After removing printInfoSystemctl and reportSystemctl content from synth-shell-greeter.sh greeter output is fixed for me

@isanych Are you running the script on Linux or Windows?

yes, WSL 2 on windows

Oh I see. You are most welcome to fix the bug for Windows and open a pull request. I'd really appreciate that. I fear I don't have the means myself to fix it for Windows; all my workstations are Linux.

Judging the error message you are getting, there are likely 2 separate issues going on:

  1. There is probably some bash and shell (sh) code mixed in that function. That should be easy to fix. ([' '' -eq 0 ']' -bash: [: : integer expression expected)
  2. Windows does obviously not run systemd to manage its daemons, so calls to it will fail (System has not been booted with systemd as init system (PID 1). Can't operate.)

Cheers

@isanych Have a look at 22daf45. It should fix the systemd issue, but I can't test it on windows. Please let me know if it worked ;)

@andresgongora it is fixed in wsl and in docker, both looks fine now.