Skip to content

minisvc.8

Manvendra Bhangui edited this page Nov 13, 2024 · 5 revisions

NAME

minisvc - daemontools mini Service Configuration Tool

SYNOPSYS

minisvc [ options ]

DESCRIPTION

minisvc is a shell frontend for configuring supervise(8) services under svscan(8). For every service created, it also creates a supervised log service, that uses multilog(8), in /var/log/svc direcotry. You can install svscan(8) to be started by the system using the command

minisvc --config=add-boot.

Similarly, you can remove svscan(8) from startup by using the command

minisvc --config=rm-boot.

minisvc offers tiny subset of indimail-mta's svctool(8) config tool features.

svctool can be used to dump the entire configuration of indimail on stdou.

minisvc --servicedir=/service --dumpconfig --cntrldir=/etc/indimail/control

minisvc requires root privilege to run.

Services & Environment variables

svctool primary function is for creating supervised services in /service. You can change the location of the service directory by specifying --servicedir option.

When you create any service, svctool stores the entire command line invocation wth arguments in /service/name/variables/.options. This allows svctool to recreate entire configuration for a service when you use the --refreshsvc option. Using envdir(8), supervise(8) services can be run with set of environment variables or a set of variables removed from the environment. The environment variables are those needed by applications run by supervise(8). These environment variables are stored as files in /service/name/variables directory. svctool can store all environment variables set for a service in /service/name/variables/.variables. This file can be created by running the command

svctool --servicedir=/service --save-variables --force

Once you have saved all environment variables as key=value lines in a file, svctool can restore all environment variables to original state by running the command

svctool --servicedir=/service --restore-all-variables --force

name refers to a supervised service name. See svscan(8), supervise(8).

OPTIONS

Usage: minisvc [OPTION]

Known values for OPTION are:

--svscanlog --servicedir=service_path [--initcmd=cmmd --scanint=n --resolvconf]

  service_path - Path where supervise service will be installed
  cmmd         - Program/Script to run instead of .svscan/run
  n            - Scan interval for svscan command
  --resolvconf - mount /etc/indimail/resolv.conf as /etc/resolv.conf
                 Use if you have dnscache installed in $servicedir/dnscache

--unshare
  Use unshare to mount private /etc/resolv.conf for using local dns

--down
  Create supervisor services in down state

--rmsvc=service_name

  Disable supervise scripts for service
  service_name   - name of service with full path
                   e.g. (/service/qmail-smtpd.25)
                   (give multiple services enclosed in double quotes)
                   "/service/qmail-smtpd.25 /service/qmail-imapd.143"

--ensvc=service_name

  Enable supervise scripts for service
  service_name   - name of service with full path
                   e.g. (/service/qmail-smtpd.25)
                   (give multiple services enclosed in double quotes)
                   "/service/qmail-smtpd.25 /service/qmail-imapd.143"

--refreshsvc=service_name
  [--run-file-only] [--force]

  Enable supervise scripts for service
  service_name   - name of service with full path
                   e.g. (/service/qmail-smtpd.25)
                   (give multiple services enclosed in double quotes)
                   "/service/qmail-smtpd.25 /service/qmail-imapd.143"
                   service_name can be "all" to act on all services
  run-file-only  - Recreate run files but not variables
  force          - Recreate service even if it has norefreshsvc flag
  NOTE: if the file .norefreshsvc is present in the variable or the config
  directory, refresh is skipped

--autorefresh="0|1 service_name"

  Disable/Enable auto refresh of supervise scripts for service
  0              - Disable autorefresh (create .norefreshsvc in variables directory)
  1              - Enable  autorefresh (delete .norefreshsvc in variables directory)
  service_name   - name of service with full path
                   e.g. (/service/qmail-smtpd.25)
                   service_name can be "all" to act on all services

--enable-service name1 name2 ..

  Add a service to be started at system boot. The unit file for the service should exist
  name1 name2 .. - name of a service or list of services to be added
                   This should be a SYSV style service, systemd, event.d unit file

--disable-service name1 name2 ..

  Remove a service to be started at system boot. The unit file for the service should exist
  name1 name2 .. - name of a service or list of services to be removed
                   This should be a SYSV style service, systemd, event.d unit file

--config=add-boot|rm-boot|users|rmusers|inittab|cert
  [--postmaster=user[@domain]]
  [--common_name=CN]
  [--validity_days=days]
  [--capath=ca_path_dir]
  [--certdir=certdir]
  [--update-certs]

  add-boot       - Add startup scripts for IndiMail to get started during boot
  rm-boot        - Remove Startup scripts to prevent IndiMail to get started after boot
  users          - Create Internal System Users needed by svscan
  rmusers        - Delete Internal System Users needed by svscan
  inittab        - Install svscan started by configuration in /etc/inittab
  cert           - Generate SSL Certificate
  postmaster     - name of the user who will recieve bounces on the local host.
                   This can also be a remote user i.e. &[email protected]
  common_name    - Common Name (CN) for server
  days           - Number of days for which the Certificate should be valid
  ca_path_dir    - Directory having CA certificate
  certdir        - Directory in which new certificates will be placed
  update-certs   - Update CERTDIR, CERTFILE and TLSCACHE for services using them

--check-certs=[full path of certificate]
  Check certificate given as argument or
  Check IndiMail Certificates in /etc/indimail/certs without any arguments

--set-variable=n --variable-value=v
  --servicedir=service_path
  --service-name=service_name
  [--force]

  Set a new variable for a supervise service
  n              - variable name
  v              - variable value
  service_path   - Path where supervise service will be installed
  service_name   - Service name
  force          - Overwrite variable if it exists

--modify-variable=n --variable-value=v
  --servicedir=service_path
  --service-name=service_name
  [--force]

  Modify an existing variable for a supervise service
  n              - variable name
  v              - variable value
  service_path   - Path where supervise service will be installed
  service_name   - Service name
  force          - Set the variable even if does not exist

--unset-variable=n
  --servicedir=service_path
  --service-name=service_name

  Unset any existing environment variable named 'n'
  n              - variable name
  service_name   - Service name

--remove-variable=n
  --servicedir=service_path
  --service-name=service_name

  Remove an existing variable for a supervise service
  n              - variable name
  service_path   - Path where supervise service will be installed
  service_name   - Service name

--restore-variables
  --servicedir=service_path
  --service-name=service_name

  Clean and Restore all variables to original state from
  servicedir/service_name/variables/.variables file
  service_path   - Path where supervise service will be installed
  service_name   - name of supervise service without path
                   e.g. (qmail-smtpd.25)

--import-variables=file
  --servicedir=service_path
  --service-name=service_name
  [--force]

  Import new environment variables from a file having one more multiple
  key=value pairs
  file           - File from which to import key=value environment variables
  service_path   - Path where supervise service will be installed
  service_name   - name of supervise service without path
                   e.g. (qmail-smtpd.25)
  force          - Set the variable if variable already exists

--export-variables=file
  --servicedir=service_path
  --service-name=service_name
  [--force]

  Export existing environment variables to a file
  file           - File in which to save key=value environment variables
  service_path   - Path where supervise service will be installed
  service_name   - name of supervise service without path
                   e.g. (qmail-smtpd.25)
  force          - overwrite service_path/service_name/variables/.variables

--save-variables
  --servicedir=service_path

  Export variables for all service in /service and
  /etc/indimail/control/defaultqueue
  service_path   - Path where supervise service will be installed

--restore-all-variables
  --servicedir=service_path

  Restore all variables to orignal state for all service in
  /service and /etc/indimail/control/defaultqueue
  service_path   - Path where supervise service will be installed

--print-variables
  --servicedir=service_path
  --service-name=service_name | --envdir=dir

  Print environment variables for a service
  service_path   - Path where supervise service will be installed
  service_name   - name of supervise service without path
                   e.g. (qmail-smtpd.25)
  dir            - Environment variables directory

--print-all-variables
  --servicedir=service_path

  Print environment variables all services
  service_path   - Path where supervise service will be installed

--dumpconfig --servicedir=service_path --cntrldir=cntrl_path

  Dumps all service configuration for Supervise Scripts, control files and software information
  service_path - Path where supervise service will be installed
  cntrl_path   - Path where Qmail control files are stored

--help

  display this help and exit

--version

  output version information

RETURN VALUE

svctool returns non-zero status on error.

SEE ALSO

IndiMail(7) initsvc(1), svscan(8), svstat(8), svc(8), supervise(8), multilog(8)

Clone this wiki locally