Skip to content

how to use machine parameter? #121

@yabb85

Description

@yabb85

I try to execute equivalent code as:

systemctl --user --machine=myuser@ show --property=ActiveState,SubState mopidy

I tried the following code, but I can't see my user service:

with DBus(user_mode=True) as bus:
     with Manager(bus=bus) as m:
         for unit_info in m.Manager.ListUnits():
             unit = Unit(unit_info[0], _autoload=True)
             if 'mopidy' in unit.Unit.Names:
                 print(unit.Unit.Names, unit.Unit.ActiveState)

Do you know how to use equivalent of parameter --machine with pystemd please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions