- LSB METHODS
- OTHER METHODS
- BUGS AND CAVEATS
- COPYRIGHT AND LICENSE
Ubic::Cmd - ubic methods with pretty printing.
When using ubic from simple scripts, you want to print some output about what happened when starting/stopping service.
This package mostly conforms to
Ubic module API (i.e. to LSB init-script API).
use Ubic::Cmd; Ubic::Cmd->start("aaa.bbb");
All methods of this class can be invoked as class methods, but you can construct your own instance if necessary (although constructor doesn't have any options by now, so it is useless).
All following methods do the same things as methods in
Ubic, but they also print messages about their actions.
- do_custom_command($service, $command)
Do non-LSB command.
Print command's usage.
WARNING: exits on invocation!
- traverse($name_or_service, $callback)
Process each subservice of
$callback, printing correct indentations.
- print_status($name, $force_cached)
- print_status($name, $force_cached, $results)
Print status of given service identified by name or by object.
$force_cachedis true, prints status cached in watchdog file. Otherwise, check for real status if current user is root or if current user is equal to service user.
Run given command for given service and exit with LSB-compatible exit code.
Service's name or arrayref with names.
Command to execute.
Force command on protected multiservice.
BUGS AND CAVEATS
Interface of this class is unstable and can be changed without further notice.
When in doubt, consider Ubic or system("ubic COMMAND SERVICE") instead.
Vyacheslav Matyukhin <firstname.lastname@example.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Yandex LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.