Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: System has not been booted with systemd as init system (PID 1). Can't operate. #952

Closed
joedborg opened this issue Jan 5, 2022 · 6 comments
Labels
kind/bug Something isn't working stale

Comments

@joedborg
Copy link

joedborg commented Jan 5, 2022

System information

  • Operating System: Ubuntu 20.04
  • Architecture: amd64
  • Apple M1: No
  • Docker version: 20.10.12
  • Docker image used in act: ghcr.io/catthehacker/ubuntu:full-20.04
  • act version: 0.2.24

Expected behaviour

systemctl start snapd to work

Actual behaviour

| System has not been booted with systemd as init system (PID 1). Can't operate.
| Failed to connect to bus: Host is down

Workflow and/or repository

    steps:
      - name: Checking out repo
        uses: actions/checkout@v2.4.0
      - name: Prepare apt
        run: |
          sudo apt-get update
          sudo apt-get upgrade -y
      - name: Install snapd
        run: |
          sudo apt-get install snapd -y
          sudo systemctl start snapd.service
      - name: Install lxd
        run: |
          sudo snap install lxd

Steps to reproduce

Run above code.

act output

| System has not been booted with systemd as init system (PID 1). Can't operate.
| Failed to connect to bus: Host is down
@joedborg joedborg added the kind/bug Something isn't working label Jan 5, 2022
@catthehacker
Copy link
Member

It's not possible to run snap since act is using Docker containers, you can try with --privileged but without mounting special paths and/or running own systemd inside container it's most likely going to fail.

@joedborg
Copy link
Author

joedborg commented Jan 6, 2022

Hey @catthehacker, I do understand why this happening, but I do believe it's a but. The reason I believe this is because it breaks the first statement in the readme: "Run your GitHub Actions locally!".

In my very inexperienced (with the guts of act) opinion, I would guess running systemd inside the container is the fix. This would mean that you can have a like-for-like experience with GitHub Actions. I understand that this might feel overkill, especially for those GHA's that are just checkout and flake8, but I do think act needs to be able to run everything you could within any GHA.

@catthehacker
Copy link
Member

catthehacker commented Jan 6, 2022

Currently it's not possible to run everything, act is making a compromise between ease of use and compatibility, by leveraging Docker.
I think the comment "Run your GitHub Actions locally!" is before even GitHub re-made how GHA works, while it still applies there is a lot that GitHub does and act can't due to GHA runner complexity and features.
To be completely compatible it would require to run completely on host (#97)
Here is more context: cli/cli#3585

I also wouldn't like to misrepresent act, so it's better if @cplee takes a gander here in terms of "act being able to run everything", as I'm mostly technical person (and not an author of this tool) and can do only as much.

@joedborg
Copy link
Author

joedborg commented Jan 6, 2022

Thank you @catthehacker. I agree that Docker is probably being used to find a pragmatic balance, but I think it'll ultimately restrict act, which is think is a fantastic tool, too much. It's my belief that things that'll always run well inside a Docker container, e.g. flake8 is almost as simple to just run on the host; it's the complex workflows I really want to be able to just run act and see if it passes before pushing.

My guess would be to fix this with machine containers (lxc, kvm, multipass etc.) instead of Docker.

@catthehacker
Copy link
Member

https://github.com/ChristopherHX/runner.server might work made by one of contributors, though I have never used it

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2022

Issue is stale and will be closed in 14 days unless there is new activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants