Dear Mentors,
in runit, services are defined as directories with files inside and
I'm not sure what exactly can or can't be done when a package has to
purge a service:
if the service is below /etc, files provided by the package can
be removed even if modified,
but the directory can't be removed if there are extra files inside.
Correct?
if the service is below /usr (or /var or /run)
instead the directory can be removed entirely, disregarding extra files ?
what if the service is in /home, like in user-services ? maybe symlinks
and empty directories (created by the package) can be removed, but not
files?
if the service is below /etc, files provided by the package can
be removed even if modified,
Normally no.
but the directory can't be removed if there are extra files inside. Correct?
Just leave this to dpkg.
Unless by "files provided by the package" you don't mean files (and directories) actually shipped inside the package.
if the service is below /usr (or /var or /run)
"/usr (or /var or /run)" sounds wrong, those are very different cases.
instead the directory can be removed entirely, disregarding extra
files ?
This sounds very wrong in general.
what if the service is in /home, like in user-services ? maybe
symlinks and empty directories (created by the package) can be
removed, but not files?
Maintainer scripts must not touch /home.
if the service is below /etc, files provided by the package can
be removed even if modified,
Normally no.
but the directory can't be removed if there are extra files inside. Correct?
Just leave this to dpkg.
Unless by "files provided by the package" you don't mean files (and directories) actually shipped inside the package.
Yes that's the case, there are files, symlinks and subdirectories
created during runtime, and I need to clean up on purge.
I'm taking what dpkg does as a reference; also policy 10.7.3 and 6.8
says something about purge, and it seems that what I described above
for /etc is correct, isn't it?
if the service is below /usr (or /var or /run)
"/usr (or /var or /run)" sounds wrong, those are very different cases.
few runtime files are created below /run (ancient version of the
package used /var), think of something like a PIDfile or a socket, but
inside a directory. what should I do on purge?
instead the directory can be removed entirely, disregarding extra
files ?
This sounds very wrong in general.
Can I set a runit policy that says that, under a very specific
directory, it will happen?
Should I bring this to debian-devel, debian-policy or there is another
more appropriate list?
what if the service is in /home, like in user-services ? maybe
symlinks and empty directories (created by the package) can be
removed, but not files?
Maintainer scripts must not touch /home.
this is problematic too, as, for example, it imply that the package can
not enable or disable a user-service by default; for example, a desktop environment with pipewire would come up with no sound by default, and
the user will have to manually stop/disable the pipewire service on
pipewire removal
Not sure what is the actual question you want to discuss there. If
it's runit-specific a proper place is likely also runit-specific.
[...]
Is this some runit-specific problem too? It's obviously not a problem
in the default installation with systemd and /usr/lib/systemd/user/pipewire.socket.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (1 / 15) |
Uptime: | 155:33:35 |
Calls: | 10,383 |
Files: | 14,054 |
Messages: | 6,417,848 |