Commit 0db9c4d1 authored by Aurélien Chabot's avatar Aurélien Chabot Committed by Thomas Petazzoni
Browse files

rpcbind: add systemd support



systemd files taken from Arch Linux.

[Thomas:
 - fix indentation
 - indicate source of systemd files.]

Signed-off-by: default avatarAurélien Chabot <aurelien@chabot.fr>
Acked-by: default avatarMaxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent 6c8d93c8
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -14,11 +14,27 @@ RPCBIND_CONF_ENV += \
	CFLAGS="$(TARGET_CFLAGS) `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`"
RPCBIND_DEPENDENCIES += libtirpc host-pkgconf
RPCBIND_CONF_OPTS += --with-rpcuser=root

ifeq ($(BR2_INIT_SYSTEMD),y)
RPCBIND_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
else
RPCBIND_CONF_OPTS += --with-systemdsystemunitdir=no
endif

define RPCBIND_INSTALL_INIT_SYSTEMD
	$(INSTALL) -m 0755 -D package/rpcbind/rpcbind.service \
		$(TARGET_DIR)/usr/lib/systemd/system/rpcbind.service
	$(INSTALL) -m 0755 -D package/rpcbind/rpcbind.socket \
		$(TARGET_DIR)/usr/lib/systemd/system/rpcbind.socket
	mkdir -p $(TARGET_DIR)/etc/systemd/system/sockets.target.wants
	ln -fs ../../../../usr/lib/systemd/system/rpcbind.socket \
		$(TARGET_DIR)/etc/systemd/system/sockets.target.wants/rpcbind.socket
endef

define RPCBIND_INSTALL_INIT_SYSV
	$(INSTALL) -m 0755 -D package/rpcbind/S30rpcbind \
		$(TARGET_DIR)/etc/init.d/S30rpcbind
endef


$(eval $(autotools-package))
+10 −0
Original line number Diff line number Diff line
[Unit]
Description=RPC bind service
Requires=rpcbind.socket

[Service]
Type=forking
ExecStart=/usr/bin/rpcbind

[Install]
Also=rpcbind.socket
+8 −0
Original line number Diff line number Diff line
[Unit]
Description=RPCbind Server Activation Socket

[Socket]
ListenStream=/var/run/rpcbind.sock

[Install]
WantedBy=sockets.target