Start and Stop pgAdmin4 correctly on Ubuntu 16.04

12.2k views Asked by At

I'm working on a project that involves the creation of a dashboard (SpringBoot + angular.js webapp) for the interrogation of Zabbix. For the purpose of testing I installed Ubuntu 16.04 LTS (VirtualBox), PostgreSQL 9.6 in which I imported by command line the database dump (pg_dump) made by the customer and also installed the GUI pgAdmin4 and connected it to the db I restored.

now I have installed pgAdmin4 this way:

as root:

sudo apt-get install build-essential libssl-dev libffi-dev libgmp3-dev virtualenv python-pip libpq-dev python-dev
cd /opt/
mkdir enviromentpy
cd enviromentpy/
virtualenv pgadmin4
cd pgadmin4
source bin/activate
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.1/pip/pgadmin4-2.1-py2.py3-none-any.whl
pip install pgadmin4-2.1-py2.py3-none-any.whl
touch lib/python2.7/site-packages/pgadmin4/config_local.py
echo "SERVER_MODE = False" >> lib/python2.7/site-packages/pgadmin4/config_local.py

After that launching

python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

I see the following output:

pgAdmin4 started, go to http://127.0.0.1:5050 through your browser

Now if I launch Firefox at above address I see the GUI and I have imported my postgres db's

Question is:

1) How can I stop correctly the service?? I mean the pgAdmin GUI not the postgres DBMS

2) To start it again I made this procedure:

cd /opt/enviromentpy
virtualenv pgadmin4
cd pgadmin4
source bin/activate
python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

Is it correct??

3) Sometimes, after a period of inactivity, ubuntu freeze, no activity is possible and I can only turn off the machine through the virtualbox menu. Do you know why?

Can you help me??

Thanks a lot

1

There are 1 answers

0
anneb On

I tried CTRL-C to stop the job, but on my Ubuntu 16.04 this does not kill the process.

You can lookup the process id and use kill -9 to terminate the process. However, a quicker solution is to type in another terminal window:

killall pgAdmin4

and pgadmin4 should terminate.