0

The bigger goal:

Writing a batch user manager targeted at classroom school environments.

The problem

I want to write a user manager that uses a GUI to add, manage and delete users for classroom environments. The program I'm working on is ltsp-manager.

Up until now all the user management is done by executing bash commands. From a python script. Meaning all the GUI has to run as root and everything is handcrafted.

The goal

Create a Dbus service that handles all the account management and let the GUI run as a regular user requiring a password from time to time.

I looked around and found that in org.freedesktop.Accounts there is already a service doing a lot of the functionality I want to do. However, it also lacks some. Something that is totally missing is the management of Groups.

What is a good way to use the org.freedesktop.Accounts functionality and add some additional functions/methods?

Thoughts so far

Things that came to my mind include:

  1. just redo everything - meaning a lot of duplicated work.
  2. copy the interfaces and write functions that call the original ones
  3. write a service that only implements the additional functions without touching the original ones. The client will then use the original service and the newly written one.

All my testing experiments are done with python3 and pydbus which seems to be the best choice among many.

I have never written a real world dbus service - though the experiments do show some results in d-feet. This question is not really a what do I need to type kind of question but rather a best practise question.

1 Answer 1

0

The best long-term answer would be to fix accountsservice upstream to implement groups support. There’s already work towards that; it just needs someone to pick it up and finish it off. accountsservice is the project which provides the canonical implementation of org.freedesktop.Accounts.

The other approaches are bad because:

just redo everything - meaning a lot of duplicated work.

As you say, this is a lot of duplicated work, and then you have to maintain it all.

copy the interfaces and write functions that call the original ones

That means you have to forever keep up with changes and additions to accountsservice.

write a service that only implements the additional functions without touching the original ones. The client will then use the original service and the newly written one.

That doesn’t come with any additional maintenance problems, but means your service won’t integrate well with accountsservice. There might be race conditions between updates on your D-Bus objects and updates on the accountsservice objects, for example. You won’t be able to share the maintenance burden of the groups code with the (many) other users of accountsservice.

1
  • Thank you for your answer you probably are right! - I was hesitant because of the announced replacement of org.freedesktop.Accounts by SSSD which would have all the neccessary interfaces. However this seems to take quite some time to be completed. I could try to complete the group branch of Accountsservice but that means I need to fix a thing because I want to fix a thing because I want to fix a thing - when is this going to end ;( …
    – enaut
    Nov 21, 2018 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.