7

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

CoderJammer
  • 599
  • 3
  • 8
  • 27
  • I think I solved as follows: when the pgAdmin4 GUI running, type **CTRL+C** on the Terminal. Process will killed but you reamain in virtual environment (you can notice it from the prefix `(pgadmin4)` before your cursor on the command line); simply type `exit` and you'll came back to a normal shell. To restart the service simply create a service or a script with follows commands: `source /opt/enviromentpy/pgadmin4/bin/activate` `python /opt/enviromentpy/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py` Hope helps – CoderJammer Nov 08 '18 at 17:02

1 Answers1

5

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.

Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76
anneb
  • 5,510
  • 2
  • 26
  • 26