App-Munner
view release on metacpan or search on metacpan
}
}
return uniq @apps;
}
sub config_help {
my $message = shift || q{};
print <<"HELP";
$message
munner.yml config template:
---------------------------
base_dir: "... base directory to find the app ..."
apps:
web-frontend:
dir: "... either full path or the tail part after base_dir ..."
env:
## specify the username of the running process
- USER: web
- PID_FILE: /tmp/web.pid
- ACCESS_LOG: /var/log/web.acc.log
- ERROR_LOG: /var/log/web.err.log
run: "... command ..."
carton: 1 or 0
db-api:
dir: "... path cound find the command to run ..."
env:
- USER: db
## Having your own pid file and access and error log path
- PID_FILE: /tmp/db.pid
- ACCESS_LOG: /var/log/db.acc.log
- ERROR_LOG: /var/log/db.err.log
- foo: 1
- bar: 2
leash: "make sure all the child processes stopped"
run: "... start up command ..."
event-api:
dir: "websrc/event-api"
env:
- USER: event
## access and error log will be stored at app dir
## specific your pid file path
- PID_FILE: /var/log/event.pid
- CHILD_PROCESS_LEASH: "make sure no abandoned children procresses"
run: bin/app.pl
carton: 1
login-server:
## Use abs path as app base path
dir: /home/gateway/websrc/login-server
env:
- USER: gateway
## Using LOG_DIR for pid file, access log and error log
- LOG_DIR: /var/log
run: bin/app.pl
carton: 1
ssh-port-forward:
dir: /tmp
env:
- USER: me
## Using TERMINAL to let ssh stay alive in the background
- TERMINAL: 1
timeout: 5
run: ssh -L 3306:localhost:3306 db-server
groups:
database:
## only start these apps
apps:
- login-server
- db-api
events:
apps:
- login-server
- event-api
website:
## start apps and above groups
apps:
- web-frontend
groups:
- database
- events
initd:
## add startup script in /etc/init.d folder
## to run "munner duck -g initd"
groups:
- website
- database
- events
HELP
exit;
}
( run in 1.925 second using v1.01-cache-2.11-cpan-f56aa216473 )