.TH cpsv 8 "December 4, 2022" "" "GNU/Linux System Adminstrator's manual" .SH NAME cpsv \- utility to install and manage runit services .SH SYNOPSIS .B cpsv \ [-f] a .I ... .br .B cpsv \ p .I .br .B cpsv \ d .I .br .B cpsv \ [-f] s .br .B cpsv \ l .SH DESCRIPTION .BR cpsv is a tool to install runscripts from CPSV_SOURCE to CPSV_DEST. It can also be used to manage runscripts that are already installed in CPSV_DEST. .br By default in a Debian system, CPSV_SOURCE is .IR /usr/share/runit/sv and CPSV_DEST is .IR /etc/sv . .br Usually packages install runscripts directly in .IR /etc/sv/ but it's also possible to install the runscript in .IR /usr/share/runit/sv and maintain a copy of it in .IR /etc/sv/ . This is especially useful for packages that provide a large number of runscripts without the corresponding binaries, like runit-services. .SH COMMANDS .TP .B a Copy .IR from CPSV_SOURCE into CPSV_DEST, then create symlinks as when the .IR p command is used; more than one .IR name can be given with this command and each .IR directory must exists in CPSV_SOURCE. .br If .IR already exists in CPSV_DEST, cpsv prints a warning, the cp invocation is skipped and the return code is increased by one. The .IR \-f option can be used to change this behaviour. .TP .B p Populate the .IR directory with symlinks; a .IR directory in CPSV_DEST must already exist. .br If a .IR /supervise symlink or directory is not found, cpsv creates one. If a .IR /.meta/finish file exists, and a .IR /finish file or symlink is not found, cpsv creates a symlink to .IR /lib/runit/finish-exec. .br When a .IR /log directory exists: if .IR /log/supervise link or directory is not found, cpsv creates one; if .IR /log/run file or symlink is not found, cpsv creates a symlink to .IR /etc/sv/svlogd/run. .TP .B d Print the diff between the .IR directory that would be created with the .IR a command and the current .IR directory in CPSV_DEST. The exit status of diff is returned; a .IR directory must exists in CPSV_SOURCE. .IR supervise , .IR conf and .IR wtime are excluded from the diff. .TP .B s Sync CPSV_DEST with CPSV_SOURCE; for each .IR directory in CPSV_SOURCE .B cpsv search the system for a systemd or sysv service file with the same name: if it finds one then it copies the .IR directory as when the .IR a command is given and goes to the next directory; else .B cpsv looks for the path written in a .IR /.meta/bin file, and if such path exists in the system then it copies the .IR directory as when the .IR a command is given; otherwise it goes to the next directory. .TP .B l List installed services in CPSV_DEST; the name of each .IR that would be copied with the .IR s command is printed, preceded with character surronded by square brakets; .br [a]: .IR ; exists in CPSV_SOURCE but not in CPSV_DEST .br [i]: .IR ; exists both in CPSV_SOURCE and CPSV_DEST, the copy in CPSV_DEST is identical to the one created with the .IR a command .br [l]: .IR ; exists both in CPSV_SOURCE and CPSV_DEST, the copy in CPSV_DEST is different from the one created with the .IR a command .br .SH OPTIONS .TP .B \-f Overwrite .IR files in CPSV_DEST with .IR files in CPSV_SOURCE, no backup is provided. When a .IR /log directory exists, the .IR /log/run file or symlink is replaced with the default one that is created with the .IR p command; .IR supervise directories or symlinks are never overwritten or replaced this way. .SH ENVIRONMENT .TP .B CPSV_DEST The environment variable $CPSV_DEST overrides the default directory where services are copied. If omitted or empty, the default is .IR /etc/sv .TP .B CPSV_SOURCE The environment variable $CPSV_SOURCE overrides the default directory from where services are copied. If omitted or empty, the default is .IR /usr/share/runit/sv.src .SH AUTHOR Lorenzo Puliti .SH SEE ALSO .BR update-service (8)