update-service(8)

πŸ’– update-service(8) πŸ’–

okay bestie, gather round, because this one is literally the little command that decides which services get to exist system-wide. it lives in the System Manager's Manual section of the man pages (section 8, the sysadmin one, very main character of it), and by the end of this you're gonna be obsessed. fr fr. πŸŽ€


🌸 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 --up|--down service-directory

πŸ’… DESCRIPTION πŸ’…

so first things first, the ground rules, no cap:

  • service-directory has to be a directory that's meant to be used by runsv(8).
  • service-name must not start with a dot, and must not contain a slash. that's it, that's the law. πŸ™…β€β™€οΈ

and what does update-service actually do? it adds or removes the service-directory to/from the system-wide service supervision that runit hands out through runsvdir(8). it can also list all the registered system-wide services, or check whether one specific service-name is registered. it's giving registry office, but make it daemons. πŸ‘‘

one lil detail that's lowkey important: when you're adding a service, and the service-directory lives in /etc/, update-service makes sure that the ./supervise/ subdirectories inside the service-directory, plus the optional service-directory/log/, are symbolic links pointing into /var/lib/supervise/ β€” unless they're already symbolic links, in which case it just minds its business. 🫢


✨ OPTIONS ✨

  • --add | -a | enable β€” adds the service directory service-directory to the system-wide service supervision, under the name service-name. if you don't pass a service-name, update-service will just use the basename of service-directory. then you can use the sv(8) program to control your brand new service or query its status, like:
# sv status service-name
  • --remove | -r | disable β€” removes the service directory service-directory, which was added under the name service-name, from the system-wide service supervision. again, if service-name isn't specified, it uses the basename of service-directory. when it removes the service-directory, the exit command gets sent to the corresponding runsv(8) process, telling it to take the service down and exit afterwards. and yes you can still use sv(8) to control or query the removed service, like:
# sv status service-directory

when the service directory service-directory is removed, the service service-name gets marked as disabled by creating a .service-name symlink. this stops tools like dh_runit(1) and runit-helper from auto-enabling service-name when the package that ships service-directory gets installed or upgraded. πŸ›‘ the .service-name symlink gets removed once 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 this version of the command checks and makes sure it does not override any local settings. these commands are policy compliant and are supposed to be run only in dpkg maintainer scripts. the local admin should use enable | disable instead. know your audience, bestie. πŸ’β€β™€οΈ
  • --list | -l β€” if service-name is specified, update-service checks whether service-name is registered as a system-wide service: it prints a message and exits non-zero if it's not, or it prints the service-name and the directory it points to and exits zero if it is. if service-name isn't specified, it prints the names of all system-widely registered services, one per line. cute little guest list. πŸ“‹
  • --check | -c β€” the same as --list, but update-service doesn't print anything to standard out or standard error. silent treatment, but make it useful. 🀫
  • --up | -u β€” removes the down file, if there is one, 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, and the requested status of the service will be 'up'. this is the default. πŸ”₯
  • --down | -d β€” touches 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, and the requested status of the service will be 'down'. a service set to --down does not start automatically at boot or when a runsvchdir(8) takes place, but it can still be started using the sv(8) program, like:
# sv up service-name

🌈 ENVIRONMENT 🌈

  • SVDIR β€” the environment variable $SVDIR overrides the default services directory /etc/service/.

πŸ“ FILES πŸ“

  • /etc/service/

πŸ¦„ SEE ALSO πŸ¦„

sv(8), runsv(8), runsvdir(8)

http://smarden.org/runit/


πŸ‘‘ AUTHOR πŸ‘‘

Gerrit Pape <pape@smarden.org>


and that's the whole page, bestie β€” this was update-service(8) from the System Manager's Manual, and it ate, no crumbs left. go add a service, go disable a service, live your truth. periodt. πŸ’œβœ¨

πŸ“¦ where this page comes from