• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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