Setting environment variables for a service without a login shell on Debian
Found the solution. For debian distro creating the file /etc/default/myservice
and then adding the environment variables using the syntax export VAR=value
then sourcing the file from /etc/init.d/myservice
using
[ -r /etc/default/myservice ] && . /etc/default/myservice
solved the problem