package Ubic::Manual::Intro;

# ABSTRACT: Initial introduction


__END__
=pod

=head1 NAME

Ubic::Manual::Intro - Initial introduction

=head1 VERSION

version 1.35_01

=head1 DESCRIPTION

Ubic is a perl-based service manager.

Ubic can run any program as a service and provides frontend script C<ubic> to manage services.

Ubic includes centralized watchdog process which checks every service periodically and brings them back online if necessary.

=head1 INSTALLATION

Installing C<Ubic> is easy.

First, install the module using your favorite CPAN client, for example, C<< cpanm Ubic >>.

Second, invoke ubic-admin script to perform initial configuration: C<< ubic-admin setup >>.

If you don't like that setup process asks too many questions, you can invoke it with batch-mode option: C<< ubic-admin setup --batch-mode >>.

Alternatively, if you're using Debian or Ubuntu, you can install ubic .deb package from official launchpad PPA repository: https://launchpad.net/~berekuk/+archive/ubic.

=head1 WRITE YOUR FIRST SERVICE

Put this code in your service dir, i.e. in file I</etc/ubic/service/example> (or if you opted for home-dir installation, in I<~/ubic/service/example>):

    use Ubic::Service::SimpleDaemon;
    Ubic::Service::SimpleDaemon->new(
        bin => 'sleep 1000',
    );

Start it:

    $ ubic start example
    Starting example... started (pid 41209)

Check its status:

    $ ubic status
    example running (pid 41209)
    ubic
        ubic.ping   off
        ubic.update off
        ubic.watchdog   running (pid 93226)

Or:

    $ ubic status example
    example running (pid 41209)

Now let's see how watchdog works by killing the process (don't forget to change pid with the pid you got in status command above):

    $ kill 41209

    $ ubic status example
    example not running

    $ ubic-watchdog
    [Thu May 26 20:20:54 2011]  example is broken, restarting

You don't have to run ubic-watchdog manually; it will do its work in background in a minute.

=head1 SEE ALSO

L<Ubic::Service::SimpleDaemon> allows you to tune other service aspects other than I<bin>. Check it out.

L<< Series of blog posts written as tutorials|http://blogs.perl.org/mt/mt-search.fcgi?blog_id=310&tag=tutorial&limit=20 >>

Don't forget to read L<Ubic::Manual::Overview>, it explains everything else that ubic has to offer.

=head1 AUTHOR

Vyacheslav Matyukhin <mmcleric@yandex-team.ru>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2011 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.

=cut

