From de2dd8f473d5502c61e162594a6a6c3273270a9a Mon Sep 17 00:00:00 2001 From: Alex Suykov Date: Sat, 23 May 2015 13:05:13 +0300 Subject: [PATCH] mongoose: systemd support [Thomas: use relative symbolic link.] Signed-off-by: Alex Suykov Signed-off-by: Thomas Petazzoni --- package/mongoose/mongoose.mk | 8 ++++++++ package/mongoose/mongoose.service | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 package/mongoose/mongoose.service diff --git a/package/mongoose/mongoose.mk b/package/mongoose/mongoose.mk index 6797e58857..14f2aae152 100644 --- a/package/mongoose/mongoose.mk +++ b/package/mongoose/mongoose.mk @@ -36,6 +36,14 @@ define MONGOOSE_INSTALL_INIT_SYSV $(TARGET_DIR)/etc/init.d/S85mongoose endef +define MONGOOSE_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 644 package/mongoose/mongoose.service \ + $(TARGET_DIR)/usr/lib/systemd/system/mongoose.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -sf ../../../../usr/lib/systemd/system/mongoose.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mongoose.service +endef + define MONGOOSE_INSTALL_STAGING_CMDS $(INSTALL) -D -m 644 $(@D)/libmongoose.a \ $(STAGING_DIR)/usr/lib/libmongoose.a diff --git a/package/mongoose/mongoose.service b/package/mongoose/mongoose.service new file mode 100644 index 0000000000..12a731c832 --- /dev/null +++ b/package/mongoose/mongoose.service @@ -0,0 +1,10 @@ +[Unit] +Description=Mongoose HTTP server +After=network.target + +[Service] +ExecStart=/usr/sbin/mongoose -document_root /var/www -listening_port 80 +Restart=always + +[Install] +WantedBy=multi-user.target -- 2.30.2