---
name: "sd_bus_start"
section: "3"
platform: "linux"
package: "systemd-libs"
version: "262.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/sd_bus_start"
---

# sd\_bus\_start(3)

Initiate a bus connection to the D-bus broker daemon

## NAME

sd\_bus\_start - Initiate a bus connection to the D-bus broker daemon

## SYNOPSIS

```
#include <systemd/sd-bus.h>
```

**int sd\_bus\_start(sd\_bus \****bus***);**

## DESCRIPTION

**sd\_bus\_start()** connects an existing bus connection object to the D-Bus broker daemon, usually [**dbus-daemon**(1)](/dbus-daemon/1.md) or [**dbus-broker**(1)](/dbus-broker/1.md). The mechanism to use for the connection must be configured before the call to **sd\_bus\_start()**, using one of [**sd\_bus\_set\_address**(3)](/sd_bus_set_address/3.md), [**sd\_bus\_set\_fd**(3)](/sd_bus_set_fd/3.md), or [**sd\_bus\_set\_exec**(3)](/sd_bus_set_exec/3.md). **sd\_bus\_start()** will open the connection socket or spawn the executable as needed, and asynchronously start a **org.freedesktop.DBus.Hello()** call. The answer to the Hello call will be processed later from [**sd\_bus\_process**(3)](/sd_bus_process/3.md). If opening of the connection or queuing of the asynchronous call fail, the connection will be closed with [**sd\_bus\_close**(3)](/sd_bus_close/3.md).

In most cases, it is better to use [**sd\_bus\_default\_user**(3)](/sd_bus_default_user/3.md), [**sd\_bus\_default\_system**(3)](/sd_bus_default_system/3.md) or related calls instead of the more low-level **sd\_bus\_new()** and **sd\_bus\_start()**. The higher-level functions not only allocate a bus object but also start the connection to a well-known bus in a single function call.

## RETURN VALUE

On success, this function returns a non-negative integer. On failure, it returns a negative errno-style error code.

### Errors

**-EINVAL**

The input parameter *bus* is **NULL**.

Added in version 246.

**-ENOPKG**

Bus object *bus* could not be resolved.

Added in version 246.

**-EPERM**

The input parameter *bus* is in a wrong state (**sd\_bus\_start()** may only be called once on a newly-created bus object).

Added in version 246.

**-ECHILD**

The bus object *bus* was created in a different process.

Added in version 246.

In addition, other connection-related errors may be returned. See [**sd\_bus\_send**(3)](/sd_bus_send/3.md).

## NOTES

Functions described here are available as a shared library, which can be compiled against and linked to with the **libsystemd** [**pkg-config**(1)](/pkg-config/1.md) file.

All functions listed here are thread-agnostic and only a single thread may operate on a given object at any given time. Different threads may access the same object at different times. Multiple independent objects may be used from different threads in parallel.

The code described here uses [**getenv**(3)](/getenv/3.md), which is declared to be not multi-thread-safe. This means that the code calling the functions described here must not call [**setenv**(3)](/setenv/3.md) from a parallel thread. It is recommended to only do calls to **setenv()** from an early phase of the program when no other threads have been started.

## HISTORY

**sd\_bus\_start()** was added in version 246.

## SEE ALSO

[**systemd**(1)](/systemd/1.md), [**sd-bus**(3)](/sd-bus/3.md), [**sd\_bus\_default**(3)](/sd_bus_default/3.md), [**sd\_bus\_call\_async**(3)](/sd_bus_call_async/3.md)
