squid: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:07:42 +0000 (13:07 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 5 Jul 2015 14:07:56 +0000 (16:07 +0200)
squid comes with a .service file, but does not install it.

[Thomas: use relative path for symlink instead of absolute path.]

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

index 3d0f4d8347f279af39c276ea7524502ced31cfca..adc09e5b218c81e95cb1fa677ba4248c54b62a2b 100644 (file)
@@ -81,4 +81,12 @@ define SQUID_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S97squid
 endef
 
+define SQUID_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 0644 $(@D)/tools/squid.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/squid.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../..//usr/lib/systemd/system/squid.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/squid.service
+endef
+
 $(eval $(autotools-package))