Logic::Tools - The great new Logic::Tools!
my $tools=Logic::Tools->new(config_file => '/etc/kamailio/kamailio-tools.ini', lock_file => $lock_file, runas_user => $runas_user, logfile => '/var/log/dialog_from_kamctl.log', logsize => '100Mb', log_num => 4); my $db_host=$tools->read_config( 'dialog_from_kamctl', 'db_host'); #проверка не запущен ли этот процесс $tools->check_proc(); #запускаем как демон $tools->start_daemon() $tools->logprint("info","диалог: $state $callid $from_uri $to_uri ");
Путь до файла с конфигами на что-либо
Файл для блокировки при запуске приложения как демона, в этот файл записываедся текущий pid процесса
пользователь под которым запускать приложение
файл для сохранения лога
максимальный размер лог файла, может быть в Kb, Mb, Gb
количество сротированный лог файлов
метод для чтения параметров из конфигурационного файла config_file
возвращает занчение параметра указанной секции
проверяет процесс по lock_file на то что он уже запущен, если не запущен возвращает 1, если запущен выдает ошибку в STDERR и завершается
записывает сообщение MESSAGE в лог файл logfile, с уровнем LOGLEVEL
item LOGLEVEL - может принимать следующие значения:
trace debug info notice warning error critical alert emergency
запускает процесс как демон под пользователем runas_user, создает файл блокировки lock_file
запускает процесс как демон под пользователем runas_user, создает файл блокировки lock_file, посредством программы supervisord
lagutas, <lagutas at gmail.com>
<lagutas at gmail.com>
Please report any bugs or feature requests to bug-logic-tools at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Logic-Tools. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-logic-tools at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Logic::Tools
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Logic-Tools
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Logic-Tools
CPAN Ratings
http://cpanratings.perl.org/d/Logic-Tools
Search CPAN
http://search.cpan.org/dist/Logic-Tools/
Copyright 2013 lagutas.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
3 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
=back without =over
To install Logic::Tools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Logic::Tools
CPAN shell
perl -MCPAN -e shell install Logic::Tools
For more information on module installation, please visit the detailed CPAN module installation guide.