haveged: convert to procd
authorHannu Nyman <hannu.nyman@iki.fi>
Tue, 1 Oct 2019 20:18:46 +0000 (23:18 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Tue, 1 Oct 2019 20:18:46 +0000 (23:18 +0300)
Convert haveged init script to use procd

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 4f717a6f65b5c495aec770b507913befa40b8997)

utils/haveged/Makefile
utils/haveged/files/haveged.init

index e640e548a840e911a2b9253d0a59551220526948..2409c92f17f754d34cfea14c155c982493ef04e8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haveged
 PKG_VERSION:=1.9.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/jirka-h/haveged/tar.gz/v$(PKG_VERSION)?
index 113d64f795bd241dfecc269092a2fc163e782eca..c0b1a7ffc1118b5e19e47b218a0aa7ef0393e891 100644 (file)
@@ -1,16 +1,17 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2012 OpenWrt.org
 
 START=13
+USE_PROCD=1
 
 HAVEGED_THRESHOLD=1024
 HAVEGED_DCACHE=32
 HAVEGED_ICACHE=32
 
-start() {
-       service_start /usr/sbin/haveged -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1
-}
-
-stop() {
-       service_stop /usr/sbin/haveged
+start_service() {
+       procd_open_instance
+       procd_set_param command /usr/sbin/haveged
+       procd_append_param command -F -w $HAVEGED_THRESHOLD -d $HAVEGED_DCACHE -i $HAVEGED_ICACHE -v 1
+       procd_set_param stdout 1
+       procd_set_param stderr 1
+       procd_close_instance
 }