Svsh - Process supervision shell for daemontools/perp/s6/runit (base class)
package Svsh::SomeSupervisor; use Moo; use namespace::clean; with 'Svsh'; # implement required methods
svsh is a shell for process supervision suites of the daemontools family, including perp, s6 and runit. Refer to svsh for documentation of the shell itself. This file documents the base class for Svsh adapter classes.
svsh
daemontools
perp
s6
runit
Required, Read-Only.
The base directory from which the process supervisor is managing services.
Read-Only.
The directory where the process supervisor's tools are located. Any call to the supervisor's tools will be prefixed with this path if provided. For usage in case the tools are not in the running user's PATH environment variable.
PATH
Read-Write.
A boolean indicating whether the collapse option should be enabled.
A hash-ref of services and their statuses (this is automatically populated by the respective status() method in the adapter classes. For every service, a hash-ref with status, duration and pid keys should exist.
status()
status
duration
pid
Finds all services managed by the supervisor, and populates the statuses attribute.
Starts a list of services if they are down.
Stops a list of services (should not restart them).
Stops and starts a list of services. Generally, this is implemented with a QUIT signal to the services, but check with the specific adapter class.
QUIT
Sends UNIX signal to a list of services.
Finds the log file to which a service is writing, and displays it on screen with the tail -f command.
tail -f
These methods are not required by adapter classes. If they are not implemented, they will be unavailable in the shell.
Causes the supervisor to rescan the service directory to find new or removed services.
Terminates the supervisor. Should also terminate all running services.
Runs a shell command with zero or more arguments and returns its output. If the bindir attribute is set, and the $cmd is one of the supervision suite's library of tools, $cmd will be prefixed with bindir.
bindir
$cmd
Finds the log file into which a logging program is currently writing to. $pid is the process ID of the logging program. Currently, tinylog, s6-log, svlogd and multilog are supported.
$pid
tinylog
s6-log
svlogd
multilog
Returns undef if the file is not found.
undef
Please report any bugs or feature requests to https://github.com/ido50/Svsh/issues.
Ido Perlmuter <ido@ido50.net>
Thanks to the guys at the supervision mailing list, especially Colin Booth, for helping out with suggestions and information.
Copyright (c) 2015-2023, Ido Perlmuter ido@ido50.net.
ido@ido50.net
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
To install Svsh, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Svsh
CPAN shell
perl -MCPAN -e shell install Svsh
For more information on module installation, please visit the detailed CPAN module installation guide.