Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
f3501534
Commit
f3501534
authored
Aug 11, 2017
by
SATOH Fumiyasu
Committed by
Quanah Gibson-Mount
Apr 20, 2021
Browse files
ITS
#8707
- Add slapd.service and lloadd.service for systemd
parent
629cafc9
Changes
7
Hide whitespace changes
Inline
Side-by-side
build/top.mk
View file @
f3501534
...
...
@@ -45,6 +45,7 @@ sbindir = @sbindir@
sharedstatedir
=
@sharedstatedir@
sysconfdir
=
@sysconfdir@
$(ldap_subdir)
schemadir
=
$(sysconfdir)
/schema
systemdsystemunitdir
=
@systemdsystemunitdir@
PLAT
=
@PLAT@
EXEEXT
=
@EXEEXT@
...
...
configure.ac
View file @
f3501534
...
...
@@ -33,6 +33,9 @@ dnl OpenLDAP Autoconf Macros
builtin(include, build/openldap.m4)dnl
dnl ================================================================
m4_ifndef([PKG_PREREQ],
[m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
AC_CONFIG_AUX_DIR(build)dnl
AC_CONFIG_MACRO_DIRS([build])
...
...
@@ -2006,26 +2009,10 @@ dnl ----------------------------------------------------------------
dnl WiredTiger
ol_link_wt=no
if test $ol_enable_wt != no ; then
AC
_CHECK_
PROG(PKGCONFIG,pkg-config,yes
)
if test
"$PKGCONFIG" !
= yes ; then
AC_MSG_ERROR([could not locate pkg-config])
PKG
_CHECK_
MODULES(WT, wiredtiger
)
if test
$ol_enable_wt
= yes ; then
SLAPD_LIBS="$SLAPD_LIBS \$(WT_LIBS)"
fi
WT_INCS=`pkg-config --cflags wiredtiger`
WT_LIBS=`pkg-config --libs wiredtiger`
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
CFLAGS="$WT_INCS"
CPPFLAGS="$WT_INCS"
LDFLAGS="$WT_LIBS"
AC_CHECK_HEADERS([wiredtiger.h])
AC_CHECK_LIB(wiredtiger,wiredtiger_version,[: ok],[
AC_MSG_ERROR([could not locate wiredtiger library])
])
CFLAGS="$save_CFLAGS"
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
SLAPD_LIBS="$SLAPD_LIBS \$(WT_LIBS)"
ol_link_wt=yes
fi
...
...
@@ -2091,6 +2078,7 @@ dnl
dnl Check for systemd (only if we have a server)
dnl
WITH_SYSTEMD=no
systemdsystemunitdir=
ol_link_systemd=no
if test $ol_enable_slapd == no && test $ol_enable_balancer != yes ; then
if test $ol_with_systemd != no ; then
...
...
@@ -2117,8 +2105,18 @@ if test $ol_with_systemd != no ; then
AC_DEFINE(HAVE_SYSTEMD,1,[define if you have systemd])
SYSTEMD_LIBS="$ol_link_systemd"
WITH_SYSTEMD=yes
PKG_CHECK_VAR(systemdsystemunitdir, systemd, systemdsystemunitdir)
if test -z "$systemdsystemunitdir"; then
if test -d /usr/lib/systemd/system; then
systemdsystemunitdir=/usr/lib/systemd/system
else
systemdsystemunitdir=/lib/systemd/system
fi
fi
fi
fi
AC_SUBST(systemdsystemunitdir)
dnl ----------------------------------------------------------------
dnl Check for entropy sources
...
...
@@ -3260,7 +3258,7 @@ AC_SUBST(SLAPD_SQL_LDFLAGS)
AC_SUBST(SLAPD_SQL_LIBS)
AC_SUBST(SLAPD_SQL_INCLUDES)
AC_SUBST(WT_
INC
S)
AC_SUBST(WT_
CFLAG
S)
AC_SUBST(WT_LIBS)
AC_SUBST(BALANCER_INCLUDE)
...
...
servers/lloadd/Makefile_server.in
View file @
f3501534
...
...
@@ -29,7 +29,7 @@ OBJS = $(patsubst %.c,%.o,$(SRCS)) $(@PLAT@_OBJS)
BUILD_OPT = "--enable-balancer"
BUILD_SRV = @BUILD_BALANCER@
all-local-srv: $(PROGRAMS)
all-local-srv: $(PROGRAMS)
all-cffiles
# $(LTHREAD_LIBS) must be last!
XLIBS = $(LLOADD_L)
...
...
@@ -58,7 +58,19 @@ version.c: Makefile
version.o: version.c $(OBJS) $(LLOADD_L)
install-local-srv: FORCE
all-cffiles:
@if test -n "$(systemdsystemunitdir)"; then \
$(SED) -e "s;%LIBEXECDIR%;$(libexecdir);" \
$(srcdir)/lloadd.service > lloadd.service.tmp ; \
fi
touch all-cffiles
clean-local-srv: FORCE
$(RM) *.tmp all-cffiles
install-local-srv: install-lloadd install-conf
install-lloadd: FORCE
-$(MKDIR) $(DESTDIR)$(libexecdir)
@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-lloadd
@( \
...
...
@@ -67,3 +79,12 @@ install-local-srv: FORCE
$(DESTDIR)$(libexecdir); \
done \
)
install-conf: FORCE
@-$(MKDIR) $(DESTDIR)$(sysconfdir)
if test -n "$(systemdsystemunitdir)" && test ! -f $(DESTDIR)$(systemdsystemunitdir)/lloadd.service; then \
$(MKDIR) $(DESTDIR)$(systemdsystemunitdir); \
echo "installing lloadd.service in $(systemdsystemunitdir)"; \
echo "$(INSTALL) $(INSTALLFLAGS) -m 644 lloadd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/lloadd.service"; \
$(INSTALL) $(INSTALLFLAGS) -m 644 lloadd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/lloadd.service; \
fi
servers/lloadd/lloadd.service
0 → 100644
View file @
f3501534
[Unit]
Description
=
LDAP Load Balancer Daemon
After
=
syslog.target network-online.target
Documentation
=
man:lloadd.conf
[Service]
Type
=
notify
Environment
=
"LLOADD_URLS=ldap:/// ldapi:///" "LLOADD_OPTIONS="
EnvironmentFile
=
/etc/sysconfig/lloadd
ExecStart
=
%LIBEXECDIR%/lloadd -d 0 -h ${LLOADD_URLS} $LLOADD_OPTIONS
[Install]
WantedBy
=
multi-user.target
servers/slapd/Makefile.in
View file @
f3501534
...
...
@@ -401,11 +401,15 @@ all-cffiles: slapd $(SLAPD_DYNAMIC_BACKENDS) dynamic_overlays dynamic_pwmods
$(SED)
-e
"s;%SYSCONFDIR%;
$$
sysconfdir;"
\
-e
"s;%LOCALSTATEDIR%;
$$
localstatedir;"
\
-e
"s;%MODULEDIR%;
$$
moduledir;"
\
$(srcdir)
/slapd.conf
>
slapd.conf.tmp
;
\
$(srcdir)
/slapd.conf
>
slapd.conf.tmp
||
exit
$$
?
;
\
$(SED)
-e
"s;%SYSCONFDIR%;
$$
sysconfdir;"
\
-e
"s;%LOCALSTATEDIR%;
$$
localstatedir;"
\
-e
"s;%MODULEDIR%;
$$
moduledir;"
\
$(srcdir)
/slapd.ldif
>
slapd.ldif.tmp
;
\
$(srcdir)
/slapd.ldif
>
slapd.ldif.tmp
||
exit
$$
?
;
@
if
test
-n
"
$(systemdsystemunitdir)
"
;
then
\
$(SED)
-e
"s;%LIBEXECDIR%;
$(libexecdir)
;"
\
$(srcdir)
/slapd.service
>
slapd.service.tmp
;
\
fi
touch
all-cffiles
install-schema
:
FORCE
...
...
@@ -439,6 +443,12 @@ install-conf: FORCE
else
\
echo
"PRESERVING EXISTING CONFIGURATION FILE
$(DESTDIR)$(sysconfdir)
/slapd.ldif"
;
\
fi
if
test
-n
"
$(systemdsystemunitdir)
"
&&
test
!
-f
$(DESTDIR)$(systemdsystemunitdir)
/slapd.service
;
then
\
$(MKDIR)
$(DESTDIR)$(systemdsystemunitdir)
;
\
echo
"installing slapd.service in
$(systemdsystemunitdir)
"
;
\
echo
"
$(INSTALL)
$(INSTALLFLAGS)
-m 644 slapd.service.tmp
$(DESTDIR)$(systemdsystemunitdir)
/slapd.service"
;
\
$(INSTALL)
$(INSTALLFLAGS)
-m
644 slapd.service.tmp
$(DESTDIR)$(systemdsystemunitdir)
/slapd.service
;
\
fi
install-db-config
:
FORCE
@
-
$(MKDIR)
$(DESTDIR)$(localstatedir)
$(DESTDIR)$(sysconfdir)
...
...
servers/slapd/back-wt/Makefile.in
View file @
f3501534
...
...
@@ -34,7 +34,7 @@ BUILD_OPT = "--enable-wt"
BUILD_MOD
=
@BUILD_WT@
mod_DEFS
=
-DSLAPD_IMPORT
MOD_DEFS
=
@WT_
INC
S@
MOD_DEFS
=
@WT_
CFLAG
S@
MOD_LIBS
=
@WT_LIBS@
...
...
servers/slapd/slapd.service
0 → 100644
View file @
f3501534
[Unit]
Description
=
OpenLDAP Server Daemon
After
=
syslog.target network-online.target
Documentation
=
man:slapd
Documentation
=
man:slapd-config
Documentation
=
man:slapd-mdb
[Service]
Type
=
notify
Environment
=
"SLAPD_URLS=ldap:/// ldapi:///" "SLAPD_OPTIONS="
EnvironmentFile
=
/etc/sysconfig/slapd
ExecStart
=
%LIBEXECDIR%/slapd -d 0 -h ${SLAPD_URLS} $SLAPD_OPTIONS
[Install]
WantedBy
=
multi-user.target
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment