Openwrt/package/system/rpcd/files/rpcd.init
Petr Štetiar 52e6fb1369 rpcd: fix respawn settings
Commit 432ec292cc ("rpcd: add respawn param") has introduced infinite
restarting of the service which could be reached over network. This is
not recommended security practice as it might give potential adversary
infinite number of tries in case there might be some issue in the rpcd
or its surrounding stack.

So lets remove the currently bogus `respawn_retry` variable (it wasn't
possible to override it anyway), reverting to the previous default max.
of 5 service restarts which could be now overriden via system's UCI
settings if desired.

Cc: Jo-Philip Wich <jow@mein.io>
Cc: Florian Eckert <fe@dev.tdt.de>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Fixes: 432ec292cc ("rpcd: add respawn param")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-03-16 22:21:45 +01:00

22 lines
393 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=12
USE_PROCD=1
NAME=rpcd
PROG=/sbin/rpcd
start_service() {
local socket=$(uci -q get rpcd.@rpcd[0].socket)
local timeout=$(uci -q get rpcd.@rpcd[0].timeout)
procd_open_instance
procd_set_param command "$PROG" ${socket:+-s "$socket"} ${timeout:+-t "$timeout"}
procd_set_param respawn
procd_close_instance
}
reload_service() {
procd_send_signal rpcd
}