Yann Kerhervé


cfkctl - control ControlFreak!


cfkctl [options] command [svcref ...]

    -y, --yes           Run non-interactively without asking for confirmations
    -h, --help          Help
    -m, --man           More help
    --basedir=<dir>     change BASE (for the load command)
                        [defaults to current directory]
    --address=SOCK      UNIX or TCP socket to connect to ControlFreak
                        See ADDRESS FORMAT below for more details
                        [defaults to unix://$ENV{HOME}.controlfreak/sock]

 Service commands: (take a list of service references in arguments)
    up                  Make sure service(s) is(are) up
    down                Make sure service(s) is(are) down
    stop                Stop the service(s)s
    restart             Stop the service(s) (if up), and then start
    status              Print status(es) of service(s)
    pids                Print service pid(s)
    desc                Print a description of the service(s)
    destroy             Down a service and deletes it

 Proxy commands:
    proxystatus         Print status(es) of proxy(ies)
    proxyup <proxy>     Up specified proxy
    proxydown <proxy>   Down specified proxy; down any attached service

 Other commands
    pid <service>       Print the pid of the specified service
    list                List all services
    version             Print server's version
    shutdown            Stop everything, including cfkd

 Service references:
    all                 All known services [default]
    svcname             A string of the name of the service
    @tag                All services tagged with the tag C<tag>

  List of possible status returned:
    running             all is well
    starting            should soon be 'running' if all is well
    stopping            should soon be 'stopped' if all is well
    stopped             not ever started, downed or completed
    fail                service terminated abnormally
    fatal               couldn't start the service
    backoff             couldn't start, but will try again


Please see SYNOPSIS.


cfkctl is ControlFreak command line interface, it connects to the management port and issues commands to it.

This script is intended to manage the communication with a cfkd instance running on a local or remote host.


    ## stop everything that is not already stopped
    cfkctl down all

    ## make sure all webs are up (FastCGI processes for instance)
    cfkctl up @webs

    ## list all services
    cfkctl list

    ## status of some services
    cfkctl status
    cfkctl status @webs
    cfkctl status s1

    ## pid of services
    cfkctl pid s1
    cfkctl pids

    ## remove a service reference completely
    cfkctl destroy syncer


cfkctl can connect to a cfkd process using a UNIX or INET socket, depending on what the server is running (See cfkd manpage for details on how to set that up). By default the UNIX socket named sock in cfkd home directory is used (Usually $ENV{HOME}/.controlfreak/).

Please look at the following examples to understand the format

      /tmp/cfkd.sock            # same as the default (UNIX socket)
      unix:/tmp/cfkd.sock       # same
      tmp/cfkd.sock             # same (not recommended)
      cfkd.sock                 # ambiguous, will resolve to UNIX socket
             # TCP socket on localhost port 7000
      yourserver.com:6000       # TCP socket on yourserver.com port 6000