how to stop this gunicorn server? - gunicorn

I tried almost all commands to kill gunicorn server. but nothing is working. how can i kill these processes and free 80 port
12652 ? Ss 0:00 sudo gunicorn -b 0.0.0.0:80 foss.wsgi:application
12654 ? S 0:00 /usr/bin/python /usr/local/bin/gunicorn -b 0.0.0.0:80 foss.wsgi:application
12659 ? S 0:00 /usr/bin/python /usr/local/bin/gunicorn -b 0.0.0.0:80 foss.wsgi:application
12709 ? Ss 0:00 sudo gunicorn -b 0.0.0.0:80 foss.wsgi:application
12711 ? S 0:00 /usr/bin/python /usr/local/bin/gunicorn -b 0.0.0.0:80 foss.wsgi:application
12717 pts/11 S+ 0:00 grep --color=auto gunicorn

Grab the pid, for example 12652 here, and issue this command:
sudo kill -9 12652
That will issue a SIGKILL, which can not be caught or ignored by an application.
If the server just starts up again immediately after, it means there's some process control system or init scripts such as supervisord or systemd configured on the box, which is managing the service and can autorestart when the service goes down.
You'll have to disable it in the process control system, e.g. supervisord stop yourapp.

Related

how to kill mysql processes

My docker-compose command won't run because I have these processes running:
$ sudo lsof -nP +c 15 | grep LISTEN | grep sql
mysqld 113 _mysql 19u IPv6 0xd0786f05dec2ff3f 0t0 TCP *:3306 (LISTEN)
mysqld 113 _mysql 22u IPv6 0xd0786f05dec789ff 0t0 TCP *:33060 (LISTEN)
Every time I kill the process listed, it starts up again with a new PID.
I've already uninstalled it:
$ brew uninstall mysql
Error: No such keg: /usr/local/Cellar/mysql
How can I totally and permanently kill this?
I've tried
sudo /usr/local/mysql/bin/mysqld stop
and
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
When I try:
sudo mysql.server stop
It shows:
ERROR! MySQL server PID file could not be found!
but I still see new processes running for mysqld
(1) Search process by port sudo lsof -i tcp:3306
(2) Kill by userid pkill -u UID
Find out how mysqld is being spawned (like daemontools) and stop it from there. Or
Try killall mysqld

How to kill mysql started with "mysql_safe" script?

Short version: I started mysql with mysql_safe and I can't kill it.
Long version: Installing an older version of mysql with macport displayed this suggestion:
$ sudo port install mysql55-server
---> Computing dependencies for mysql55-server
---> Fetching archive for mysql55-server
---> Attempting to fetch mysql55-server-5.5.49_0.darwin_14.noarch.tbz2 from https://packages.macports.org/mysql55-server
---> Attempting to fetch mysql55-server-5.5.49_0.darwin_14.noarch.tbz2.rmd160 from https://packages.macports.org/mysql55-server
---> Installing mysql55-server #5.5.49_0
---> Activating mysql55-server #5.5.49_0
If this is a new install you might want to run:
$ sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db
Running that gave these instructions:
$ sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db
Installing MySQL system tables...
161102 13:15:44 [Note] /opt/local/lib/mysql55/bin/mysqld (mysqld 5.5.49) starting as process 54176 ...
OK
Filling help tables...
161102 13:15:44 [Note] /opt/local/lib/mysql55/bin/mysqld (mysqld 5.5.49) starting as process 54180 ...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/local/lib/mysql55/bin/mysqladmin -u root password 'new-password'
/opt/local/lib/mysql55/bin/mysqladmin -u root -h myusername password 'new-password'
Alternatively you can run:
/opt/local/lib/mysql55/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /opt/local ; /opt/local/lib/mysql55/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /opt/local/mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
At this point I (unwisely, it seems) ran:
$ cd /opt/local ; /opt/local/lib/mysql55/bin/mysqld_safe &
Now I cannot figure out how to stop the mysql and/or daemondo process(es):
$ ps aux | grep mysql55
myusername 54937 0.1 0.0 2432772 660 s001 R+ 1:39PM 0:00.00 grep mysql55
_mysql 54888 0.0 0.1 2667884 6340 ?? S 1:36PM 0:00.12 /opt/local/lib/mysql55/bin/mysqld --user=_mysql
root 54885 0.0 0.0 2479468 700 ?? Ss 1:36PM 0:00.00 /opt/local/bin/daemondo --label=mysql55-server --start-cmd /opt/local/lib/mysql55/bin/mysqld --user=_mysql ; --pid=exec
I've tried many variations of kill, targeting both mysql (which seems pointless) and daemondo, including (but not limited to) the following:
sudo kill -9 54888 // killing the mysql process results in a new pid
sudo kill 54885 // the doemondo process
sudo kill -SIGHUP 54885
sudo killall mysqld_safe
sudo kill -9 54822 // a reincarnation of the doemondo process
sudo mysqladmin shutdown
For centos or mint
/usr/bin# initctl
for ubuntu
pkill mysqld

POI Data Provider Installation

I'm trying to isntall POI Data provider on my ubuntu 14. The documentation is a little bit old, but I have installed everything without problems.
When I try to test my enabler:
http://localhost/poi_dp/radial_search.php?lat=1&lon=1&category=test_poi
I obtain a empty web page and this error in the javascript console:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I obtain this when I list my process:
ps ax | grep 'postgres\|mongo\|apache2'
965 ? Ssl 0:04 /usr/bin/mongod --config /etc/mongod.conf
15480 ? S 0:00 /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf
15482 ? Ss 0:00 postgres: checkpointer process
15483 ? Ss 0:00 postgres: writer process
15484 ? Ss 0:00 postgres: wal writer process
15485 ? Ss 0:00 postgres: autovacuum launcher process
15486 ? Ss 0:00 postgres: stats collector process
16161 ? Ss 0:00 /usr/sbin/apache2 -k start
16164 ? S 0:00 /usr/sbin/apache2 -k start
16165 ? S 0:00 /usr/sbin/apache2 -k start
16166 ? S 0:00 /usr/sbin/apache2 -k start
16167 ? S 0:00 /usr/sbin/apache2 -k start
16168 ? S 0:00 /usr/sbin/apache2 -k start
16188 ? S 0:00 /usr/sbin/apache2 -k start
16419 pts/4 S+ 0:00 grep --color=auto postgres\|mongo\|apache2
Whe I verify the postgres sql table
$ psql -U gisuser poidatabase
poidatabase=> SELECT count(*) FROM fw_core;
I read 4 as expected.
But whe I try to verify mongo db:
$ mongo
> use poi_db
> db.collections
I only get "poi_db.collections" and not:
The db.collections command should list five POI data component collections created by the installation: fw_contact, fw_marker, fw_media, fw_relationships and fw_time.
what is the problem? any idea? thanks.
Regarding that db.collections returns nothing try command:
$ mongo
> use poi_db
> show collections
These apparent problems have been corrected in the new release that has been pushed to GitHub https://github.com/Chiru/FIWARE-POIDataProvider.git . See the updated guide http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/POI_Data_Provider_-_Installation_and_Administration_Guide for installation. Moreover the errors e.g. in sanity-check procedure have been corrected. (Another answer below refers to an error in sanity check.)

MySQL deactivated in Lampp, Xampp on Linux 12.04

I have freshly installed xampp-linux-1.8.1 on my Ubuntu 12.04 (Mint 13 maya) Operating system.
When run lampp, I get :
/opt/lampp/lampp start
Starting XAMPP for Linux 1.8.1...
XAMPP: XAMPP-Apache is already running.
XAMPP: Another MySQL daemon is already running.
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for Linux started.
In the : localhost/xampp/
MySQL DataBase is Deactivated !!!
ps -aux | grep 'mysql'
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html mysql 3159 0.0 0.9 316264 31880 ? Ssl 16:48 0:00 /usr/sbin/mysqld
root 4745 0.0 0.0 4648 840 pts/5 S+ 17:02 0:00 grep --color=auto mysql
When I tried to stop /usr/sbin/mysqld but it can't be stopped with this command !!!
/usr/sbin/mysqld stop
Please I need Help, Thanks.
i've resolved the issue in this way:
sudo chmod -R 777 /opt/lampp
sudo chown -hR nobody /opt/lampp
sudo chmod -R 755 /opt/lampp
then stop other mysqld running with:
sudo service mysql stop
Also had this issue, after troubleshooting for almost 2 hours I found that it was because of other Apache and MySQL packages also running on my system. Removed all Apache and MySQL packages and reinstalled XAMPP again. Success.

Mysql install and remove issues

I installed mysql on ubuntu server and i dont know what went wrong...it didnt install a mysql root user so i tried to uninstall and start over and now i cant unistall
i tried this
apt-get remove php5-mysql
apt-get remove mysql-server mysql-client
apt-get autoremove
but when i do
ps aux | grep mysql
root 6066 0.0 0.0 1772 540 pts/1 S 03:21 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 7065 0.0 0.6 58936 11900 pts/1 Sl 03:33 0:00 /usr/sbin/mysqld -- basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid -- socket=/var/run/mysqld/mysqld.sock --port=3306
root 7066 0.0 0.0 2956 688 pts/1 S 03:33 0:00 logger -t mysqld -p daemon.error
root 22804 0.0 0.0 3056 780 pts/1 R+ 04:14 0:00 grep mysql
so i killed the processes and then tried to reinstall like this
apt-get -f install
sudo apt-get install mysql-server mysql-client
sudo mysqladmin -u root -h localhost password 'root'
but i get this
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'#'localhost' (using password: NO)'
im confused..i keep installing and uninstalling mysql and the same result..any ideas
it's possible that mysql is using old config files from your previous installation.
the best way to remove a package is:
sudo dpkg --purge package name
This removes all obsolete config files as well!
The root password is stored in a special "mysql" database. Look in /var/lib/mysql/mysql and see if there is anything there.
In my case, I see:
# ls /var/lib/mysql/mysql
columns_priv.frm help_category.frm ndb_binlog_index.frm slow_log.CSM time_zone_transition.frm
columns_priv.MYD help_category.MYD ndb_binlog_index.MYD slow_log.CSV time_zone_transition.MYD
columns_priv.MYI help_category.MYI ndb_binlog_index.MYI slow_log.frm time_zone_transition.MYI
db.frm help_keyword.frm plugin.frm tables_priv.frm time_zone_transition_type.frm
db.MYD help_keyword.MYD plugin.MYD tables_priv.MYD time_zone_transition_type.MYD
db.MYI help_keyword.MYI plugin.MYI tables_priv.MYI time_zone_transition_type.MYI
event.frm help_relation.frm proc.frm time_zone.frm user.frm
event.MYD help_relation.MYD proc.MYD time_zone_leap_second.frm user_info.frm
event.MYI help_relation.MYI proc.MYI time_zone_leap_second.MYD user_info.MYD
func.frm help_topic.frm procs_priv.frm time_zone_leap_second.MYI user_info.MYI
func.MYD help_topic.MYD procs_priv.MYD time_zone.MYD user.MYD
func.MYI help_topic.MYI procs_priv.MYI time_zone.MYI user.MYI
general_log.CSM host.frm servers.frm time_zone_name.frm
general_log.CSV host.MYD servers.MYD time_zone_name.MYD
general_log.frm host.MYI servers.MYI time_zone_name.MYI
If so, delete that directory and then reinstall.
You can also start mysql in a special no-password mode and then reset the password.