On Sun, 30 Jun 2024 14:42:20 +0500 Andrey Rakhmatullin <w...@debian.org> wrote:
> > > > 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? However I can't find anything for files that are not below /etc, except that log files should be deleted on purge. > > > 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 Lorenzo