Plesk stale pidfile control panel failing to start Linux

Plesk stale pidfile error Plesk wont start or gives 500 error on loading in browser.

service sw-cp-server start

You will see.

Starting SWsoft control panels server… stale pidfile. [FAILED]

Check the Plesk error log /var/log/sw-cp-server/error_log.

tail -f /var/log/sw-cp-server/error_log

2012-06-02 11:43:27: (network.c.300) can’t bind to port: 127.0.0.1 10001 Address already in use
2012-06-02 11:43:27: (log.c.75) server started
2012-06-02 11:43:27: (network.c.300) can’t bind to port: 127.0.0.1 10001 Address already in use
2012-06-02 11:43:31: (log.c.75) server started
2012-06-02 11:43:31: (network.c.300) can’t bind to port: 127.0.0.1 10001 Address already in use
2012-06-02 11:43:31: (log.c.75) server started
2012-06-02 11:43:31: (network.c.300) can’t bind to port: 127.0.0.1 10001 Address already in use

Check what is open on port 10001.

lsof -i tcp:10001

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sw-cp-ser 3179 sw-cp-server 5u IPv4 9026 TCP localhost.localdomain:scp-config (LISTEN)

Stop The Plesk service.

service sw-cp-server stop

Stoppping SWsoft control panels server… not running. [ OK ]

Remove the Plesk PID.

rm -rf /var/run/sw-cp-server.pid

Check if the Plesk process is still running.
ps ax | grep sw-cp-server | grep -v grep
3179 ? S 0:23 /usr/sbin/sw-cp-serverd -f /etc/sw-cp-server/config

Kill the process.
ps ax | grep sw-cp-server | grep -v grep | awk {‘print $1’} | xargs kill -9
Start Plesk.

service sw-cp-server start

Linux, Plesk Linux, Virtual & Dedicated Servers ,

4 responses to Plesk stale pidfile control panel failing to start Linux


  1. Degoy

    Hi,
    Many thanks for this tip.

    I had the same issue whit Plesk 9.5.4 running on Centos 6 (Linux 2.6.38.2-xxxx-std-ipv6-64 from OVH).
    I founded Plesk server stopped. /var/log/sw-cp-server/error_log said : 2012-06-17 2012-06-17 14:27:07: (network.c.300) can’t bind to port: 127.0.0.1 10001 Address already in use .

    I simply did :
    # lsof -i tcp:10001
    In my case, the PID was : 18392
    # kill 18392
    #/etc/init.d/sw-cp-server start
    … Plesk server started Ok.

    Plesk not my choice!

    Have a nice sunday!

  2. box-admin

    Cool Degoy,

    The ps ax | grep sw-cp-server | grep -v grep | awk {‘print $1’} | xargs kill -9 was to kill all if there were multiple processes.

    1. ps ax
    Prints out all running processes.
    this is then piped (passed on to) grep
    the pipe delimiter is |

    2. grep sw-cp-server, as the output of ps ax has been piped to grep sw-cp-server
    At this point this would list all the processes containg sw-cp-server including the grep process you just ran which is omitted by piping to grep -v grep which excludes the term grep in the reg ex.

    3. xargs kill -9
    This is the final command we pipe to xargs.
    Xargs basically executes anything that is inputted into it and provides it as input to a program or file. So our input through the | is run after xargs kill -9. The -9 switch is to force kill.
    So if the output of ps ax had been
    3178 ? S 0:23 /usr/sbin/sw-cp-serverd -f /etc/sw-cp-server/config
    3179 ? S 0:23 /usr/sbin/sw-cp-serverd -f /etc/sw-cp-server/config

    ps ax | grep sw-cp-server | grep -v grep | xargs kill -9
    would run the following
    kill -9 3178
    kill -9 3179

    The rm -rf /var/run/sw-cp-server.pid was to kill of any stale process.

    I agree on Plesk although I have felt a buzz in fixing there sloppy coders work, in the past 😀

  3. Danijel

    Thanks very! I have no idea why this happend to me at first place, but your tip really saved the day. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen − nine =