Service can't find files when starting from init.d

Hey,
I have build minisatip for OpenWrt.

There are some files for http in the directory: /usr/share/minisatip/html
When the Service starts from init.d minisatip can't find the files. But when I start minisatip from the command line the files are accessabel for minisatip.
I don't understand what the difference between both, the service runs always as root and the parameters are the same. I grab the parameters from 'ps' when the minisatip runs from init.d.

minisatip log:
minisatip[24763]: Could not open file /usr/share/minisatip/html//status.html

ls -al /usr/share/minisatip/html/
drwxr-xr-x    2 root     root          4096 Apr 26 19:11 .
drwxr-xr-x    3 root     root          4096 Apr 24 20:22 ..
-rw-r--r--    1 root     root         92605 Apr 26 19:11 astra.m3u
-rw-r--r--    1 root     root        270825 Apr 25 08:03 chan_iptv.m3u
-rw-r--r--    1 root     root          1875 Feb 27 22:05 dLAN.xml
-rw-r--r--    1 root     root          1752 Feb 27 22:05 dvbc.png
-rw-r--r--    1 root     root          1844 Feb 27 22:05 dvbc2.png
-rw-r--r--    1 root     root          1812 Feb 27 22:05 dvbs.png
-rw-r--r--    1 root     root          1978 Feb 27 22:05 dvbs2.png
-rw-r--r--    1 root     root          2105 Feb 27 22:05 dvbs2x.png
-rw-r--r--    1 root     root          1692 Feb 27 22:05 dvbt.png
-rw-r--r--    1 root     root          1757 Feb 27 22:05 dvbt2.png
-rw-r--r--    1 root     root         86659 Feb 27 22:05 jquery-3.2.1.min.js
-rw-r--r--    1 root     root         13565 Feb 27 22:05 jquery.dataTables.min.css
-rw-r--r--    1 root     root         82480 Feb 27 22:05 jquery.dataTables.min.js
-rw-r--r--    1 root     root           782 Feb 27 22:05 jquery.pBar.min.js
-rw-r--r--    1 root     root          9563 Feb 27 22:05 lr.jpg
-rw-r--r--    1 root     root         30780 Feb 27 22:05 lr.png
-rw-r--r--    1 root     root          1242 Feb 27 22:05 satip.xml
-rw-r--r--    1 root     root          1974 Feb 27 22:05 sm.jpg
-rw-r--r--    1 root     root          5665 Feb 27 22:05 sm.png
-rw-r--r--    1 root     root           160 Feb 27 22:05 sort_asc.png
-rw-r--r--    1 root     root           201 Feb 27 22:05 sort_both.png
-rw-r--r--    1 root     root           158 Feb 27 22:05 sort_desc.png
-rwxrwxrwx    1 root     root         12691 Feb 27 22:05 status.html

here are the init script

#!/bin/sh /etc/rc.common

USE_PROCD=1
START=92

append_arg() {
	local cfg="$1"
	local var="$2"
	local opt="$3"
	local def="$4"
	local val

	config_get val "$cfg" "$var"
	[ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}"
}

append_bool() {
	local cfg="$1"
	local var="$2"
	local opt="$3"
	local def="$4"
	local val

	config_get_bool val "$cfg" "$var" "$def"
	[ "$val" = 1 ] && procd_append_param command "$opt"
}

start_instance() {
	local cfg="$1"
	local aux
	local satip servers

	config_get_bool aux "$cfg" 'disabled' '0'
	[ "$aux" = 1 ] && return 1

	procd_open_instance

	procd_set_param command /usr/sbin/minisatip
	procd_append_param command "-f"
	procd_append_param command "-R /usr/share/minisatip/html"
	procd_append_param command "-g"
	procd_append_param command "-v all"

	append_arg "$cfg" adapter_buffers "-b"
	append_arg "$cfg" delsys "-Y"
	append_arg "$cfg" diseqc "-d"
	append_arg "$cfg" diseqc_timing "-q"
	append_arg "$cfg" dvbapi_url "-o"
	append_arg "$cfg" dvr_priority "-i"
	append_arg "$cfg" enabled_adapters "-e"
	append_arg "$cfg" http_port "-x"
	append_arg "$cfg" jess_string "-j"
	append_arg "$cfg" lnb "-L"
	append_arg "$cfg" mac_address "-m"
	append_arg "$cfg" no_power_management "-Z"
	append_arg "$cfg" playlist_url "-p"
	append_arg "$cfg" remote_rtp_host "-r"
	append_arg "$cfg" rtsp_port "-y"
	append_arg "$cfg" server_id "-D"
	append_arg "$cfg" simulate_fontends "-a"
	append_arg "$cfg" slave_adapters "-S"
	append_arg "$cfg" socket_write_buffer "-B"
	append_arg "$cfg" udp_port "-P"
	append_arg "$cfg" unicable_string "-u"
	append_arg "$cfg" xml_path "-X"
	append_arg "$cfg" xml_url "-w"

	append_bool "$cfg" clean_psi "-t"
	append_bool "$cfg" satip_tcp "-O"
	append_bool "$cfg" send_encrypted "-E"
	append_bool "$cfg" threads "-T"

	config_get servers "$cfg" satip_servers
	for satip in $servers; do
		procd_append_param command -s "$satip"
	done

	config_get_bool aux "$cfg" 'respawn' '0'
	[ "$aux" = 1 ] && procd_set_param respawn

	procd_close_instance
}

service_triggers() {
	procd_add_reload_trigger "minisatip"
}

start_service() {
	config_load minisatip
	config_foreach start_instance minisatip
}

I think your procd_append_param unction may be incorrectly used.
I suspect you need to split the string parameters as you normally would from shell.

For example: "-R /usr/share/minisatip/html" should be "-R" "/usr/share/minisatip/html" (for which the quotes add little value)

It's worth a shot (-R and -v would be the clear offenders)

Also, to see the difference in how parameters are defined on the running processes (using the process ID), you can run the following:

tr '\000' '\n' < /proc/<pid>/cmdline

Should that be
procd_append_param command "-s $satip"

Can you show us

  • a successful manual command line
  • the item in process list "ps -ww" when started by procd

That might help you in understanding what goes wrong.