# accountsservice **Repository Path**: foundui2/accountsservice ## Basic Information - **Project Name**: accountsservice - **Description**: No description available - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-25 - **Last Updated**: 2025-12-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Build Status](https://gitlab.freedesktop.org/accountsservice/accountsservice/badges/master/build.svg)](https://gitlab.freedesktop.org/accountsservice/accountsservice/pipelines) Overview ======== The AccountsService project provides o A set of D-Bus interfaces for querying and manipulating user account information. o An implementation of these interfaces based on the usermod(8), useradd(8) and userdel(8) commands. License ======= See the COPYING file. Installation ============ See the INSTALL file. Contributing ============ As with other projects hosted on freedesktop.org, accountsservice follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc: https://www.freedesktop.org/wiki/CodeOfConduct 如何在 org.freedesktop.Accounts /org/freedesktop/Accounts/User 下添加接口 ============ 1. 在data/org.freedesktop.Accounts.User.xml添加接口定义 详情可以参照文件中的写法。 2. 在src/libaccountsservice/act-user.h添加接口(尽量和其他的函数名风格保持一致,举例函数名:act_user_interface_xxx),src/libaccountsservice/act-user.c下添加接口实现 接口实现中需要注意调用一下 accounts_user_call_接口名_sync接口。这里如果不调用该接口,会导致后面编译的时候会不方便插入一个接口,出现deb打包时提示测试用例失败的问题。 3. 在doc/libaccountsservice/libaccountsservice-sections.txt添加第二步中的接口act_user_interface_xxx。 4. 在src/user.c中添加接口的注册函数,函数名可以随意取 (这里假如取名为set_user_interface_xxx) 在src/user.c的user_accounts_user_iface_init函数中添加 iface->handle_set_user_interface_xxx = set_user_interface_xxx; 5. 然后可以尝试deb编译打包一次,基本上会出现测试用例的问题,或者是检测出了接口的添加。 如果是测试用例测试的问题,建议清空掉之前的打包的缓存,重新打包。检测到接口添加,但是无法打出包,需要看看哪些接口。 6. 将第4步新增的接口和版本复制出来,添加到debian/libaccountsservice0.symbols文件中 7. 基本上做 完上述几步,打包可以成功了。 sudo killall -9 accounts-daemon sudo /usr/libexec/accounts-daemon 来重启accounts-daemon服务。 然后可以通过d-feet来查看accounts-daemon的接口,看看是否添加的接口是否正常。(注意,调用接口需要root权限,所以要sudo d-feet启动d-feet) 调用后可以发现接口超时。 超时错误是dbus没有返回,需要在src/libaccountsservice/act-user.c的接口函数中的函数return前调用 g_object_thaw_notify (G_OBJECT (user));