samba4: install systemd files
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:14:42 +0000 (13:14 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 5 Jul 2015 14:10:52 +0000 (16:10 +0200)
The package comes with usable .service files for smbd, nmbd and
winbind, but does not install them.

[Thomas: use relative paths for the symbolic links.]

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/samba4/samba4.mk

index d7d5299cdcd1ca31de568536a24b7fa13b887252..7d10a0c2e86ebda6b4abeb770af3a6f678e02c80 100644 (file)
@@ -155,4 +155,20 @@ define SAMBA4_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S91smb
 endef
 
+define SAMBA4_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 $(@D)/packaging/systemd/nmb.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/nmb.service
+       $(INSTALL) -D -m 644 $(@D)/packaging/systemd/smb.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/smb.service
+       $(INSTALL) -D -m 644 $(@D)/packaging/systemd/winbind.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/winbind.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/nmb.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/nmb.service
+       ln -sf ../../../../usr/lib/systemd/system/smb.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/smb.service
+       ln -sf ../../../../usr/lib/systemd/system/winbind.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/winbind.service
+endef
+
 $(eval $(generic-package))