# update-service - add/remove a service to/from system-wide service super... - man(8) - [phpMan]

[_update-service_(8)](https://www.chedong.com/phpMan.php/man/update-service/8/markdown)                      System Manager's Manual                     [_update-service_(8)](https://www.chedong.com/phpMan.php/man/update-service/8/markdown)

## NAME
       update-service - add/remove a service to/from system-wide service supervision

## SYNOPSIS
       **update-service **--add|--remove _service-directory_ [_service-name_**]**

       **update-service **defaults| defaults-disabled _service-directory_ [_service-name_**]**

       **update-service **--list|--check [_service-name_**]**

       **update-service **--auto|--noauto _service-directory_

## DESCRIPTION
       _service-directory_  must  be  a  directory to be used by [**runsv**(8)](https://www.chedong.com/phpMan.php/man/runsv/8/markdown), _service-name_ must not start
       with a dot, and must not contain a slash.

       **update-service **adds or removes the _service-directory_ to the system-wide  service  supervision
       provided  through  runit 's [**runsvdir**(8)](https://www.chedong.com/phpMan.php/man/runsvdir/8/markdown), lists all registered system-wide services, or checks
       for a specific _service-name_ whether it is registered.

       When adding a service, and the _service-directory_ resides in /etc/, **update-service **makes  sure
       that  the  ./supervise/ subdirectories in the _service-directory_, and the optional _service-di‐_
       _rectory_/log/, are symbolic links pointing into /var/lib/supervise/, unless they  already  are
       symbolic links.

## OPTIONS
### --add | -a | enable
              Add  the  service  directory _service-directory_ to the system-wide service supervision,
              under the name _service-name_.  If _service-name_ is not  specified,  **update-service  **will
              use  the  basename of _service-directory_.  You can use the [**sv**(8)](https://www.chedong.com/phpMan.php/man/sv/8/markdown) program to control the
              newly added service, or query its status, e.g.:

              # sv status _service-name_


### --remove | -r | disable
              Remove the service directory _service-directory_, which has been added  under  the  name
              _service-name_, from the system-wide service supervision.  If _service-name_ is not speci‐
              fied,  **update-service  **will  use the basename of _service-directory_.  When removing the
              _service-directory_, the _exit_ command is sent to  the  corresponding  [**runsv**(8)](https://www.chedong.com/phpMan.php/man/runsv/8/markdown)  process,
              telling  it  to take the service down and exit afterwards.  You can use the [**sv**(8)](https://www.chedong.com/phpMan.php/man/sv/8/markdown) pro‐
              gram to control the removed service, or query its status, e.g.:

              # sv status _service-directory_

              When the service directory _service-directory_ is removed, the service _service-name_ will
              be marked as disabled by creating a _.service-name_ symlink.  This  will  prevent  tools
              like  [**dh_runit**(1)](https://www.chedong.com/phpMan.php/man/dhrunit/1/markdown)  and  runit-helper from auto-enabling _service-name_ at install or up‐
              grade of the package that ships _service-directory_.  The _.service-name_ symlink will  be
              removed as the _service-directory_ is added again to the system-wide service supervision
              or when the package that ships _service-directory_ is purged.


### defaults | defaults-disabled
              Respectively the same as enable | disable, but the command checks and make sure to not
              override  any  local settings. These commands are policy compliant and are supposed to
              be run only in dpkg maintaner scripts. The local admin should use enable | disable in‐
              stead.


### --list | -l
              If _service-name_ is specified, **update-service **checks whether _service-name_ is registered
              as system-wide service, prints a message and exits non-zero if not, or prints the _ser‐_
              _vice-name_ and the directory it points to and exits zero if yes.   If  _service-name_  is
              not  specified,  it prints the names of all system-widely registered services, one per
              line.

### --check | -c
              The same as --list, but **update-service **doesn't print anything to standard out or stan‐
              dard error.


### --auto | -u
              Remove the down file, if any, from the directory  _service-directory_.   This  way,  the
              service  represented by the _service-directory_ will be started and monitored as soon as
              a runsv process is started for that directory; the requested  status  of  the  service
              will  be  'up'.   This  is  the default.  If _service-name_ is given, will be ignored as
              **--auto **directly act on the _service-directory_ and thus only takes _service-directory_  as
              argument.

### --noauto | -n
              Touch  a  down  file  into the _service-directory_.  This way the service represented by
              _service-directory_ will not be automatically started when a runsv  process  is  started
              for  that  directory.   The requested status of the service will be 'down'.  A service
              set to **--noauto **does not start automatically at boot or  when  a  [**runsvchdir**(8)](https://www.chedong.com/phpMan.php/man/runsvchdir/8/markdown)  takes
              place, but can still be started using the [**sv**(8)](https://www.chedong.com/phpMan.php/man/sv/8/markdown) program, e.g.:

              # sv up _service-name_

              If  _service-name_ is given, will be ignored as **--noauto **directly act on the _service-di‐_
              _rectory_ and thus only takes _service-directory_ as argument.


## ENVIRONMENT
       **SVDIR  **The environment variable $SVDIR overrides the  default  services  directory  _/etc/ser‐_
              _vice/_.

## FILES
       /etc/service/

## SEE ALSO
       [sv(8)](https://www.chedong.com/phpMan.php/man/sv/8/markdown), [runsv(8)](https://www.chedong.com/phpMan.php/man/runsv/8/markdown), [runsvdir(8)](https://www.chedong.com/phpMan.php/man/runsvdir/8/markdown)

       <http://smarden.org/runit/>

## AUTHOR
       Gerrit Pape <<pape@smarden.org>>

                                                                                   [_update-service_(8)](https://www.chedong.com/phpMan.php/man/update-service/8/markdown)
