On Sun, Jun 30, 2024 at 08:08:58PM +0200, lorenzo 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?

Yes, it's fine to delete configuration files 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?

Those files should be created when a process starts and removed when it
ends so it's not a job of a maintainer script to clean them. Even if for
some reason they aren't cleaned properly after the process ended, they
will be removed on the next reboot.

> > > 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?

I know nothing about runit or its policies.

> Should I bring this to debian-devel, debian-policy or there is another
> more appropriate list?

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.

> > > 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

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.

-- 
WBR, wRAR

Attachment: signature.asc
Description: PGP signature

Reply via email to