like apachectl for Dancer
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



dancerctl - Like apachectl for perl/Dancer apps. Small tool that can start/stop/restart Dancer apps.


dancerctl action [appname [environment]]

Where action can be

start, stop, restart
startall, stopall, restartall, statusall

environment - usually 'development' or 'production' (by default). Default environment is used if no environment specified.

Examples under not root user:

dancerctl start|stop|restart|status app [environment]
dancerctl startall|stopall|restartall|status|statusall
dancerctl help
dancerctl init appname path [force]

Examples under root(!) user: [not implemented now]

dancerctl user [action [app [environment]]]

Not implemented now, but will be in future

dancerctl setup   [not implemented]
dancerctl update  [not implemented]
dancerctl list    [not implemented]

dancerctl init

init will create config for app with default recommended values. Default config can be placed in recommended: section to /etc/dancerctl.conf otherwise the __DATA__ section of dancerctl script will be used.

dancerctl init appname path [force]
    * path counted from user dir: app -> /home/user/app
    * when 'force' the config file will be overwritten if exists.


# example 1: 
    dancerctl init app path/to/app
# example 2: 
    cd path/to/app
    dancerctl init app `pwd`
# example 3: config will be recreated
    cd path/to/app
    dancerctl init app `pwd` force

Configs (ORDER BY priority DESC)

~/.dancerctl/$appname [environment: section]
~/.dancerctl/$appname [root param]

Config format: YAML for the ~/.dancerctl/$appname and any ini-style (better YAML too) for the /etc/dancerctl.conf

Config example

See app.yml which should be moved to /home/user/.dancerctl/ and renamed to app.

    * NOTE! Names of parameters in config can be changed in next versions

Global %ENV params

It is possible to use to global parameters in %ENV:

DANCERCTL_CONF  - default config for dancerctl, instead of /etc/dancerctl.conf
DANCERCTL_DEBUG - enable/disable debug mode, has more priority, then in dancerctl.conf

  export DANCERCTL_CONF=/path/to/local/dancerctl.conf
  DANCERCTL_DEBUG=1 dancerctl statusall


perl 5.10, Config::Auto and YAML::Tiny are required.

curl -L -k | perl - --self-upgrade
cpanm Config::Auto YAML::Tiny

cd ~
mkdir dancerctl
cd dancerctl
git clone git:// ./
alias d='~/dancerctl/dancerctl'
d help

dancerctl was tested under modern version of Ubuntu (11.04). Some parts (like 'status') may not work under different linuxes and OSes (note hardcoded slashes and format of ps lax).

You can get 'dev' branch with latest changes with

git clone git:// ./ -b dev  

Copyright (c) 2011, Nick Knutov,,


BSD 2-Clause License (