---
name: "sam_start"
section: "3"
platform: "linux"
package: "libsam-dev"
version: "3.1.9-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/sam_start"
---

# sam\_start(3)

Start health checking

## NAME

sam\_start - Start health checking

## SYNOPSIS

**#include \<corosync/sam.h\>**

**cs\_error\_t sam\_start (void);**

## DESCRIPTION

The **sam\_start** function is used to start health checking of application. After calling this function, the active process needs to send healthchecks within the registered time interval by calling **[sam\_hc\_send(3)](/sam_hc_send/3.md)**.  If event driven healthchecking is configured by calling **[sam\_register(3)](/sam_register/3.md)**, an internal thread will be created and send health check confirmations four times per *time\_interval*.

Application must be registered by calling **[sam\_register(3)](/sam_register/3.md)** before this function can be called.

An application can always stop health checking by calling the **[sam\_stop(3)](/sam_stop/3.md)** function.

If SAM is initialized with quorum policy *SAM\_RECOVERY\_POLICY\_QUIT* or *SAM\_RECOVERY\_POLICY\_RESTART* **sam\_start** will block until corosync becomes quorate.

## RETURN VALUE

This call return CS\_OK value if successful, otherwise and error is returned. If SAM is initialized with quorum policy, returned error can also be quorum error.

## ERRORS

- CS\_ERR\_BAD\_HANDLE

  component was not registered by calling **[sam\_register(3)](/sam_register/3.md)** function.

## SEE ALSO

[**sam\_hc\_send**(3)](/sam_hc_send/3.md), [**sam\_stop**(3)](/sam_stop/3.md), [**sam\_register**(3)](/sam_register/3.md), [**sam\_hc\_callback\_register**(3)](/sam_hc_callback_register/3.md)

**CS\_ERR\_TRY\_AGAIN** Resource temporarily unavailable

**CS\_ERR\_INVALID\_PARAM** Invalid argument

**CS\_ERR\_ACCESS** Permission denied

**CS\_ERR\_LIBRARY** The connection failed

**CS\_ERR\_INTERRUPT** System call interrupted by a signal

**CS\_ERR\_NOT\_SUPPORTED** The requested protocol/functionality not supported

**CS\_ERR\_MESSAGE\_ERROR** Incorrect auth message received

**CS\_ERR\_NO\_MEMORY** Not enough memory to complete the requested task
