App-govproc-pericmd

 view release on metacpan or  search on metacpan

script/govproc-pericmd  view on Meta::CPAN


=item B<--format>=I<s>

Choose output format, e.g. json, text.

Default value:

 undef

=item B<--json>

Set output format to json.

=item B<--naked-res>

When outputing as JSON, strip result envelope.

Default value:

 0

By default, when outputing as JSON, the full enveloped result is returned, e.g.:

    [200,"OK",[1,2,3],{"func.extra"=>4}]

The reason is so you can get the status (1st element), status message (2nd
element) as well as result metadata/extra result (4th element) instead of just
the result (3rd element). However, sometimes you want just the result, e.g. when
you want to pipe the result for more post-processing. In this case you can use
`--naked-res` so you just get:

    [1,2,3]


=back

=head2 Restart options

=over

=item B<--restart>

If set to true, do restart.

=back

=head2 Screensaver options

=over

=item B<--no-screensaver>

Prevent screensaver from being activated.

=back

=head2 Setuid options

=over

=item B<--egid>=I<s>

Set EGID(s) of command process.

Need to be root to be able to setuid.


=item B<--euid>=I<s>

Set EUID of command process.

Need to be root to be able to setuid.


=back

=head2 Timeout options

=over

=item B<--timeout>=I<s>

Apply execution time limit, in seconds.

After this time is reached, process (and all its descendants) are first sent the
TERM signal. If after 30 seconds pass some processes still survive, they are
sent the KILL signal.

The killing is implemented using <pm:IPC::Run>'s `kill_kill()`.

Upon timeout, exit code is set to 124.


=back

=head2 Other options

=over

=item B<--help>, B<-h>, B<-?>

Display help message and exit.

=item B<--version>, B<-v>

Display program's version and exit.

=back

=head1 COMPLETION

This script has shell tab completion capability with support for several
shells.

=head2 bash

To activate bash completion for this script, put:

 complete -C govproc-pericmd govproc-pericmd

in your bash startup (e.g. F<~/.bashrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is recommended, however, that you install modules using L<cpanm-shcompgen>
which can activate shell completion for scripts immediately.

=head2 tcsh

To activate tcsh completion for this script, put:

 complete govproc-pericmd 'p/*/`govproc-pericmd`/'

in your tcsh startup (e.g. F<~/.tcshrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is also recommended to install L<shcompgen> (see above).

=head2 other shells

For fish and zsh, install L<shcompgen> as described above.

=head1 CONFIGURATION FILE

This script can read configuration files. Configuration files are in the format of L<IOD>, which is basically INI with some extra features.

By default, these names are searched for configuration filenames (can be changed using C<--config-path>): F<~/.config/govproc-pericmd.conf>, F<~/govproc-pericmd.conf>, or F</etc/govproc-pericmd.conf>.

All found files will be read and merged.

To disable searching for configuration files, pass C<--no-config>.

You can put multiple profiles in a single file by using section names like C<[profile=SOMENAME]> or C<[SOMESECTION profile=SOMENAME]>. Those sections will only be read if you specify the matching C<--config-profile SOMENAME>.

You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...

Finally, you can filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOME...

List of available configuration parameters:

 command (see --command)
 egid (see --egid)
 euid (see --euid)
 format (see --format)
 killfam (see --killfam)
 load_check_every (see --load-check-every)
 load_high_limit (see --load-high-limit)
 load_low_limit (see --load-low-limit)
 load_watch (see --load-watch)
 log_level (see --log-level)
 log_stderr (see --log-stderr)
 log_stdout (see --log-stdout)
 naked_res (see --naked-res)
 name (see --name)
 no_screensaver (see --no-screensaver)
 on_multiple_instance (see --on-multiple-instance)
 pid_dir (see --pid-dir)
 restart (see --restart)
 show_stderr (see --no-show-stderr)
 show_stdout (see --no-show-stdout)
 single_instance (see --single-instance)
 timeout (see --timeout)

=head1 ENVIRONMENT

=head2 GOVPROC_PERICMD_OPT => str

Specify additional command-line options.

=head1 FILES

F<~/.config/govproc-pericmd.conf>

F<~/govproc-pericmd.conf>

F</etc/govproc-pericmd.conf>

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-govproc-pericmd>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-govproc-pericmd>.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-govproc-pericmd>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=head1 SEE ALSO

L<govproc>

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE



( run in 1.400 second using v1.01-cache-2.11-cpan-ceb78f64989 )