[GH-ISSUE #952] Issue: System has not been booted with systemd as init system (PID 1). Can't operate. #559

Closed
opened 2026-03-01 21:44:30 +03:00 by kerem · 6 comments
Owner

Originally created by @joedborg on GitHub (Jan 5, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/952

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
Originally created by @joedborg on GitHub (Jan 5, 2022). Original GitHub issue: https://github.com/nektos/act/issues/952 ## 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 ```
kerem 2026-03-01 21:44:30 +03:00
Author
Owner

@catthehacker commented on GitHub (Jan 6, 2022):

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.

<!-- gh-comment-id:1006665142 --> @catthehacker commented on GitHub (Jan 6, 2022): 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.
Author
Owner

@joedborg commented on GitHub (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.

<!-- gh-comment-id:1006838257 --> @joedborg commented on GitHub (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.
Author
Owner

@catthehacker commented on GitHub (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 (https://github.com/nektos/act/issues/97)
Here is more context: https://github.com/cli/cli/issues/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.

<!-- gh-comment-id:1006922201 --> @catthehacker commented on GitHub (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 (https://github.com/nektos/act/issues/97) Here is more context: https://github.com/cli/cli/issues/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.
Author
Owner

@joedborg commented on GitHub (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.

<!-- gh-comment-id:1006927827 --> @joedborg commented on GitHub (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.
Author
Owner

@catthehacker commented on GitHub (Jan 6, 2022):

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

<!-- gh-comment-id:1006942512 --> @catthehacker commented on GitHub (Jan 6, 2022): https://github.com/ChristopherHX/runner.server might work made by one of contributors, though I have never used it
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2022):

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

<!-- gh-comment-id:1030717720 --> @github-actions[bot] commented on GitHub (Feb 6, 2022): Issue is stale and will be closed in 14 days unless there is new activity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#559
No description provided.