Here is an example, taken from Symfony2 website, about defining a custom service (YAML notation):
services: newsletter_manager:
you can use
php app/console container:debug
to get a list of all available public service IDs or
php app/console container:debug --show-private
to show both public and private service IDs