I'm trying to execute a Python script that starts software for my server. The server software must run in a terminal window for user input and status information.
- Server has GUI
- Ubuntu 19.10
- folder structure: ~/parent/START_SERVER.py
- The Python3.8 script requires user input from the terminal
START_SERVER.py (set as executable):
#!/usr/bin/env python3.8 import os # Several lines of code os.system('java -jar server.jar')
./parent/START_SERVER.pyin .bashrc in home directory
python3.8 /parent/START_SERVER.pyto .bashrc
python3.8 ~/parent/START_SERVER.pyto .bashrc
- Adding the above commands to Startup Applications
- Creating a symbolic link in /etc/profile.d to START_SERVER.py
- Doing all of the above with START_SERVER.sh pointing to START_SERVER.py
- 1-5 sometimes results in a popup on login that says "Are you sure you want to proceed?" with one option: "ok"
- When 5 is attempted, I get the following on login:
Error found when loading /etc/profile:
/etc/profile.d/START_SERVER.sh: line 3:
----> Outputs line 3 of my file, finding part of a comment that says "./START_SERVER.py"<------:No such file or directory
/etc/profile.d/START_SERVER.sh: line 6: syntax error near unexpected token `('
/etc/profile.d/START_SERVER.sh: line 6: `def setSettings():'
At this point I'm really at a loss for what to do. How do I get this script to run at login?