• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Restarting sw-cp-server never works

danami

Silver Pleskian
For a while now I've noticed that on Plesk 12 the sw-cp-server init scripts can never restart the sw-cp-server properly. I have to manually kill the master process then restart it:

Code:
# /etc/init.d/sw-cp-server restart
Stopping sw-cp-serverd:  [FAILED]
Starting sw-cp-serverd: nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
^C
# ps aux | grep sw-cp-server
root  13376  0.0  0.0  45424  1532 ?  Ss  2014  0:00 sw-cp-server: master process /usr/sbin/sw-cp-serverd -c /etc/sw-cp-server/config
503  13377  0.0  0.0  46468  4108 ?  S  2014  0:00 sw-cp-server: worker process
root  13615  0.0  0.0 103244  840 pts/0  S+  11:51  0:00 grep sw-cp-server
# kill 13376 13377
# /etc/init.d/sw-cp-server restart
Stopping sw-cp-serverd:  [FAILED]
Starting sw-cp-serverd:  [  OK  ]
 
Why is there no response to this? It is not only a valid question but a problem that many people are facing. See below for example:

[root@webhost1 certificates]# service sw-cp-server restart
Stopping sw-cp-serverd: [FAILED]
Starting sw-cp-serverd: nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:12443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8880 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:12443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8880 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:12443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8880 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:12443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8880 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:6308 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:12443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8880 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:8880 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]
 
I fixed my own problem and will post the fix here for the OP.

On the command line type lsof -i 8443

This will return something like this:

[root@webhost1 certificates]# lsof -i :8443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sw-cp-ser 8627 root 9u IPv4 36562572 0t0 TCP *:pcsync-https (LISTEN)
sw-cp-ser 8627 root 11u IPv6 36562574 0t0 TCP *:pcsync-https (LISTEN)
sw-cp-ser 8628 sw-cp-server 3u IPv4 375504414 0t0 TCP webhost1.teksavvy.com:pcsync-https->206.248.154.140:55751 (ESTABLISHED)
sw-cp-ser 8628 sw-cp-server 9u IPv4 36562572 0t0 TCP *:pcsync-https (LISTEN)
sw-cp-ser 8628 sw-cp-server 11u IPv6 36562574 0t0 TCP *:pcsync-https (LISTEN)
sw-cp-ser 8628 sw-cp-server 16u IPv4 375504473 0t0 TCP webhost1.teksavvy.com:pcsync-https->206.248.154.140:42744 (ESTABLISHED)
sw-cp-ser 8628 sw-cp-server 17u IPv4 375504474 0t0 TCP webhost1.teksavvy.com:pcsync-https->206.248.154.140:48856 (ESTABLISHED)
sw-cp-ser 8628 sw-cp-server 18u IPv4 375504545 0t0 TCP webhost1.teksavvy.com:pcsync-https->206.248.154.140:59566 (ESTABLISHED)
sw-cp-ser 8628 sw-cp-server 21u IPv4 375504546 0t0 TCP webhost1.teksavvy.com:pcsync-https->206.248.154.140:59546 (ESTABLISHED)
sw-cp-ser 8628 sw-cp-server 22u IPv4 375504547 0t0 TCP webhost1.teksavvy.com:pcsync-https->206.248.154.140:38696 (ESTABLISHED)


Then kill -9 8627 8628
Then service sw-cp-server restart

That should fix your problem.
 
Back
Top