From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

#!/usr/bin/env bash
VERSION='v2.3.2'
warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; }
perl -MNarada -E 'Narada::detect(@ARGV)' narada || exit 1
[ $# -ne 0 ] || die "Usage: narada-bg command [args]"
exec 3>>.lock.bg
flock -s -n 3 || die "Failed to get shared lock on .lock.bg"
exec "$@"
: <<'=cut'
=encoding utf8
=head1 NAME
narada-bg - run background command for this project
=head1 VERSION
This document describes narada-bg version v2.3.2 narada-bg command [args]
=head1 DESCRIPTION
Should be executed in project deploy directory.
Start given command with shared lock on C<.lock.bg>.
You should use C<narada-bg> to start all project's background commands -
everything run by cron, qmail or as services. All commands which was run
using C<narada-bg> should be automatically killed on project upgrade or
downgrade or restoring from backup (use C<narada-bg-killall>).
=head1 CONFIGURATION AND ENVIRONMENT
.lock.bg
=head1 SUPPORT
=head2 Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker
You will be notified automatically of any progress on your issue.
=head2 Source Code
This is open source software. The code repository is available for
public review and contribution under the terms of the license.
Feel free to fork the repository and submit pull requests.
=head2 Resources
=over
=item * MetaCPAN Search
=item * CPAN Ratings
=item * AnnoCPAN: Annotated CPAN documentation
=item * CPAN Testers Matrix
=item * CPANTS: A CPAN Testing Service (Kwalitee)
=back
=head1 AUTHOR
Alex Efros E<lt>powerman@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2008-2015 by Alex Efros E<lt>powerman@cpan.orgE<gt>.
This is free software, licensed under:
The MIT (X11) License
=cut