0
0
mirror of https://github.com/openwrt/packages.git synced 2025-01-31 04:51:44 +00:00
packages/net/freeradius3/files/radiusd.init
Eiji MATSUMOTO f4e9f07391 freeradius3: Fix to init script.
To use eap tls, 'tmpdir' must be created before server starts.
This 'tmpdir' is used to store and verify client certificate,
and therefore radiusd do 'chmod go-rwx'.

If 'tmpdir' does NOT exists, server failed to start and default
'tmpdir' is '/tmp/radiusd'. So init script MUST create default
'tmpdir' like other directories.

Signed-off-by: Eiji MATSUMOTO <toudaiman@gmail.com>
2020-05-05 12:03:10 +09:00

30 lines
573 B
Bash

#!/bin/sh /etc/rc.common
#
# Copyright (C) 2006-2015 OpenWrt.org
#
USE_PROCD=1
START=50
NAME=radiusd
PROG=/usr/sbin/radiusd
DEFAULT=/etc/default/radiusd
start_service()
{
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p /var/log
mkdir -p /var/run
mkdir -p /var/db/radacct
mkdir -p /tmp/radiusd
procd_open_instance
procd_set_param command $PROG -s
procd_set_param env LD_LIBRARY_PATH=/usr/lib/freeradius3
[ -n "$IPADDR" ] && procd_append_param command -i $IPADDR
[ -n "$OPTIONS" ] && procd_append_param command $OPTIONS
procd_set_param respawn
procd_close_instance
}