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-directoryhas to be a directory that's meant to be used byrunsv(8).service-namemust 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 directoryservice-directoryto the system-wide service supervision, under the nameservice-name. if you don't pass aservice-name,update-servicewill just use the basename ofservice-directory. then you can use thesv(8)program to control your brand new service or query its status, like:
# sv status service-name
--remove|-r|disableβ removes the service directoryservice-directory, which was added under the nameservice-name, from the system-wide service supervision. again, ifservice-nameisn't specified, it uses the basename ofservice-directory. when it removes theservice-directory, theexitcommand gets sent to the correspondingrunsv(8)process, telling it to take the service down and exit afterwards. and yes you can still usesv(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 asenable|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 useenable|disableinstead. know your audience, bestie. πββοΈ--list|-lβ ifservice-nameis specified,update-servicechecks whetherservice-nameis registered as a system-wide service: it prints a message and exits non-zero if it's not, or it prints theservice-nameand the directory it points to and exits zero if it is. ifservice-nameisn'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, butupdate-servicedoesn't print anything to standard out or standard error. silent treatment, but make it useful. π€«--up|-uβ removes thedownfile, if there is one, from the directoryservice-directory. this way, the service represented by theservice-directorywill be started and monitored as soon as arunsvprocess is started for that directory, and the requested status of the service will be'up'. this is the default. π₯--down|-dβ touches adownfile into theservice-directory. this way the service represented byservice-directorywill not be automatically started when arunsvprocess is started for that directory, and the requested status of the service will be'down'. a service set to--downdoes not start automatically at boot or when arunsvchdir(8)takes place, but it can still be started using thesv(8)program, like:
# sv up service-name
π ENVIRONMENT π
SVDIRβ the environment variable$SVDIRoverrides the default services directory/etc/service/.
π FILES π
/etc/service/
π¦ SEE ALSO π¦
π 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
- ubuntu questing: runit 2.2.0-4ubuntu1
- ubuntu resolute: runit 2.3.0-1ubuntu1 Β· BSD-3-Clause
- ubuntu stonking: runit 2.3.1-5ubuntu1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms