Install Tryton in a Python virtual environment on Ubuntu

I created a bash script in /srv/tryloc/ which activates the virtual env and starts the server as trysysuser. When I su to trysysuser and cd to /srv/tryloc, the commands work but in a script the commands don’t work, the . /bin/activate command is executed but the server is not started.
The plan is to start a script as ‘home-user’ which starts the server as trysysuser and then starts the client as ‘home-user’
How can I achieve this?

I’m trying to understand this why you would do that? What you can do is to automatically start the server on booting your PC with a systemd file. Take a look at https://discuss.tryton.org/t/deploying-tryton-with-a-python-virtual-environment to get Gunicorn up-and-running which should be enough.

For development purposes I would recommend to open a terminal and start the server from there, so you can see the errors when they pop up, and start another terminal to run the client or use the prebuild one like Flatpak.

1 Like

OK, thanks, I see what you mean.

Just in case someone is curious about the outcome of the production level installation with the apache2/gunicorn combination.
In a nutshell: the system is up and running, the tryton server can be accessed through the internet (I tested that with a desktop client, not with the web client).
What I did:
Prerequisite: webserver linked to a domain name with a DNS A record and port 8000 open.

  1. follow edbo’s post by the book Deploying Tryton with a Python virtual environment
    to the point where the gunicorn server is started and a systemd file is created. At this point the trytond server can be started with user@host:/$ systemctl start trytond
  2. follow gunicorn behind Apache web server – ServerOK to configure apache
    in the virtual host file adjust ServerName, ServerAdmin, DocumentRoot, ErrorLog, CustomLog, ProxyPass and ProxyPassReverse to the settings of your system.
    ProxyPass / http://(your domain ip):8000/
    ProxyPassReverse / “http://(your domain ip):8000/”
  3. enable your virtual host configuration (a2ensite (virtualhost).conf)
  4. restart the apache2 server

If the gunicorn server is running you can reach your trytond server through the internet at http://<your.domain>