Skip to content

UseSystemd() does nothing when ProtectProc=invisible is set #125368

Closed

Description

@mrek-msft

Description

In comment on 88660 user complained that UseSystemd() does nothing when ProtectProc=invisible is set. It's likely because in that case systemd hides files which UseSystemd uses for detection if running on systemd based system or not. Since issues is different from originally reported (support non-sytemd × sometimes do not work at systemd), creating separate issue for tracking it for case we pick approach that do not solves them both at once.

Reproduction Steps

Run Microsoft.Extensions.Hosting based app with ProtectProc=invisible set in systemd service unit file

Expected behavior

Should behave like running under systemd

Actual behavior

UseSystemd does nothing

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. added
    untriaged
    on Mar 10, 2026
  2. dotnet-policy-service commented on Mar 10, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-extensions-hosting
    See info in area-owners.md if you want to be subscribed.

  3. tmds commented on Mar 10, 2026

    @tmds
    Member

    @mrek-msft the option that is discussed in #88660 would work equally well for ProtectProc=invisible. It's not likely we'd do something that would not work for it. Do we need this extra ticket at this time?

  4. mrek-msft commented on Mar 10, 2026

    @mrek-msft
    MemberAuthor

    @tmds I do not know. I can imagine alternative like do not relaxing checks in UseSystemd and introduce some new UseXXX for non-systemd. It seems semantically wrong to me to extend UseSystemd to support far more than systemd and can limit us if we decide to support some systemd specific features. In case of approaching it in separate way, we would need to solve mentioned issues separately. Maybe another ways that I am not aware of exists.

    Feel free to close it if you think it do not make sense at all.

  5. tmds commented on Mar 10, 2026

    @tmds
    Member

    We can create a separate issue if that is a result of the discussion on #88660. At this point, having a separate issue might only cause the discussion to be split across two issues.

  6. removed
    untriaged
    on Mar 10, 2026
  7. locked and limited conversation to collaborators on Apr 10, 2026
  8. added this to the 11.0.0 milestone on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions