EFF_USER and USER is missing for DSM7 in service-script.sh
root@NAS /v/h/seby# cat /var/packages/dante-sockd/scripts/service-setup
### Generic variables and functions
### -------------------------------
if [ -z "${SYNOPKG_PKGNAME}" ] || [ -z "${SYNOPKG_DSM_VERSION_MAJOR}" ]; then
echo "Error: Environment variables are not set." 1>&2;
echo "Please run me using synopkg instead. Example: \"synopkg start [packagename]\"" 1>&2;
exit 1
fi
# Service port
SERVICE_PORT="@socks_port@"
[..]
https://github.com/SynoCommunity/spksrc/blob/95fe355fbab4426b6e81a937b35a01894a6d2d15/mk/spksrc.service.mk#L112-L127
Removing the SERVICE_USER check at line 123 fixes the issue
Defining SERVICE_USER would fix it too but DSM7 doesn't really have that concept anymore, and I thought they ($USER) were previously defined anyway. But I might be wrong on that.
I think the use of SERVICE_USER should not impact the $USER variable. What does the EFF_USER stand for anyway? Shouldn't it be something like SRV_USER or SERVICE_USER? Just my 2 cents.
$EFF_USER should contains of the $USER with the prefix "sc-" for DMS 6 and higher So $EFF_USER = "sc"- + $USER when DSM >= 6 else $USER
In pre DSM 6 packages the name of the user was the same as the name of the package (e.g. $SYNOPKG_PKGNAME) When @ymartin59 created the framework for DSM 6, we had to decide how to support older versions of DSM (DSM 5 and DSM 4). We decided to add the "sc-" prefix for the username of packages and for installing on pre-DSM 6 the username without this prefix was kept.
So in every package the EFF_USER is used and depending on the DSM version it is equal to the USER if the DSM version is lower then 6 else (DSM6 and higher) and the "sc-" prefix is added to create EFF_USER.
Because of the fact that DSM 7 packages can only be installed on DSM 7, it could be that this is no longer necessary.
Thanks @BenjV I much appreciate the history lesson :)