[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFS: minidlna (updated package)

Michael Tautschnig wrote:
> Hi Benoît,
> > I am looking for a sponsor for the new version 1.0.18-5
> > of my package "minidlna".
> > 
> [...]
> Looks pretty good, and I really like the fact that multiple people seem to be
> working on it, makes package maintenance a lot more future-proof :-) Built and
> uploaded!

Thanks for the quick upload!

> Just one thing, though, that I don't really like, which you might want to
> reconsider for the next release:
> rm -rf ${PIDDIR}
> Couldn't this be avoided by doing some rm -f ${PIDDIR}* ; rmdir ${PIDDIR}
> (probably you can't do an rm -f without *, which would have been even nicer). rm
> -rf just feels so unsafe...

I completely understand your feeling; rm -rf, especially ran as root,
always gives me the feeling of doing something highly dangerous.

My first idea was actually to do:

  rm -f ${PIDFILE}
  rmdir ${PIDDIR} 2>/dev/null || true

or something like that, that would only remove the file we expect to see
in the ${PIDDIR} directory, and then remove the directory or fail
silently if it doesn't exist/isn't empty. But it seemed to be more
trouble than necessary for a directory located in the possibly volatile
/var/run directory, where users should definitely not write anything of
value. But if anyone sees a good reason to preserve whatever might have
been put in this directory, I can of course change this in the next


Benoît Knecht

Reply to: