Issue
I have a client who has an existing Red Hat Linux server setup on Amazon Web Services (AWS) where the important Python server code is launched as a service using sudo service bigserver2 start
. When I try and run the bigserver2.py Python script independently, there are a number of runtime issues for paths and files not found. How can I backtrack through the service system and understand what environment the service is running in so I can replicate and debug some issues.
I can see the bigserver2
service running when I run sudo service --status-all
and it looks like they are initiating a command with some paths added, but I don't know where my predecessor (now gone and unavailable) set things up or what else may impact the environment.
root 14207 1 0 20:15 ? 00:00:00 sudo -u webuser LD_LIBRARY_PATH=/opt/webusershared/python/ext PYTHONPATH=/opt/webusershared/python/ext/ /usr/bin/python3.6 /opt/webusershared/bigserver2.py
Solution
Since you are using service command instead of systemctl, I am guessing you are on REHL 6 (consider upgrading).
/etc/init.d/
Check this path, you will find a file with a name starting with "bigserver2".
Answered By - Kashish Bhatia Answer Checked By - Pedro (WPSolving Volunteer)