@@ -135,8 +135,8 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool)
135135 return controllers , nil
136136}
137137
138- // GetAvailableControllers get string:bool map of all the available controllers
139- func GetAvailableControllers (exclude map [string ]controllerHandler , cgroup2 bool ) ([]string , error ) {
138+ // AvailableControllers get string:bool map of all the available controllers
139+ func AvailableControllers (exclude map [string ]controllerHandler , cgroup2 bool ) ([]string , error ) {
140140 availableControllers , err := getAvailableControllers (exclude , cgroup2 )
141141 if err != nil {
142142 return nil , err
@@ -392,20 +392,13 @@ func (c *CgroupControl) CreateSystemdUnit(path string) error {
392392 return systemdCreate (c .config .Resources , path , conn )
393393}
394394
395- // GetUserConnection returns an user connection to D-BUS
396- func GetUserConnection (uid int ) (* systemdDbus.Conn , error ) {
397- return systemdDbus .NewConnection (func () (* dbus.Conn , error ) {
398- return dbusAuthConnection (uid , dbus .SessionBusPrivateNoAutoStartup )
399- })
400- }
401-
402395// CreateSystemdUserUnit creates the systemd cgroup for the specified user
403396func (c * CgroupControl ) CreateSystemdUserUnit (path string , uid int ) error {
404397 if ! c .systemd {
405398 return fmt .Errorf ("the cgroup controller is not using systemd" )
406399 }
407400
408- conn , err := GetUserConnection (uid )
401+ conn , err := UserConnection (uid )
409402 if err != nil {
410403 return err
411404 }
0 commit comments