| 1 |
'\" t |
| 2 |
.TH "SD_BOOTED" "3" "" "systemd 261~rc3" "sd_booted" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
sd_booted \- Test whether the system is running the systemd init system |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.sp |
| 26 |
.ft B |
| 27 |
.nf |
| 28 |
#include <systemd/sd\-daemon\&.h> |
| 29 |
.fi |
| 30 |
.ft |
| 31 |
.HP \w'int\ sd_booted('u |
| 32 |
.BI "int sd_booted(void);" |
| 33 |
.SH "DESCRIPTION" |
| 34 |
.PP |
| 35 |
\fBsd_booted()\fR |
| 36 |
checks whether the system was booted up using the systemd init system\&. |
| 37 |
.SH "RETURN VALUE" |
| 38 |
.PP |
| 39 |
On failure, this call returns a negative errno\-style error code\&. If the system was booted up with systemd as init system, this call returns a positive return value, zero otherwise\&. |
| 40 |
.SH "NOTES" |
| 41 |
.PP |
| 42 |
Functions described here are available as a shared library, which can be compiled against and linked to with the |
| 43 |
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1) |
| 44 |
file\&. |
| 45 |
.PP |
| 46 |
Internally, this function checks whether the directory |
| 47 |
/run/systemd/system/ |
| 48 |
exists\&. A simple check like this can also be implemented trivially in shell or any other language\&. |
| 49 |
.SH "SEE ALSO" |
| 50 |
.PP |
| 51 |
\fBsystemd\fR(1), \fBsd-daemon\fR(3) |