<div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Hi All,</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">I'm in the situation where path of my server changes due to version change. I don't want to modify my systemd unit file everytime, instead I want to go ahead with my environement file for modification.</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">My Env file system.env contains environment variables</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">system.env</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">========</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">SERVER_PATH=/home/raghu/TAP/server/V110<br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">In my systemd unit file I have included this enviroment file.</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Tap.service</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">========</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">[Unit]</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Description=Starting TAP server </div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">[Service]</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">EnvironmentFile=/home/raghu/system.env</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><b>WorkingDirectory=${SERVER_PATH}</b></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><b>ExecStart=/home/raghu/TAP/out "./server.js"</b></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">[Install]</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">WantedBy=multi-user.target</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">I'm stuck with the below error</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default"><font face="times new roman, serif" size="4"><b><i>error: Cannot find module '/server.js'</i></b></font><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">${SERVER_PATH} is not set to my WorkingDirectory. Instead of using this variable, if I give the absolute path, my unit file works well.</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Need help in resoling this issue.</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div><div class="gmail_signature"><div dir="ltr"><div><font style="font-family:"times new roman",serif" size="2"></font><font face="times new roman,serif"><font size="4">--<br>Regards,<br><br>Raghavendra. H. R<br>(Raghu)</font><br></font></div></div></div></div>
</div>