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

Re: Bug#34408: samba: sambaconfig hoses inetd.conf if interrupted at first prompt (fwd)

> Well, I would agree with you that system files should be backed up before
> making modifications to them. However, I don't think the postinst of my
> package should be bloated to do this. I think it should be the program
> that my postinst calls the one that should take care of things like
> this. For example, if my program calls update-inetd then it should be this
> program the one that makes the security copy of the original inetd.conf.

update-inetd does precisely this: it creates a file
/etc/inetd.conf.new and only when it has successfully written that
file does it rename it to /etc/inetd.conf.  So if anything goes wrong,
the initial /etc/inetd.conf is intact.

> So, should I start filing bug reports against those packages that
> modify system files without making copies of them first? I don't think
> that's appropiate.

Yes, you should.  If there are any such packages, it is a serious
bug.  But before you file bug reports, do check that they don't make
backups or, ideally, write to a temporary file which is renamed to the
original at the end.

In your case (again, I haven't read your code, so I can't comment),
the bug report was talking about the /etc/inetd.conf being hosed.
Does this mean that you perhaps do one of the following: (a) call
update-inetd twice, allowing for the possibility of a useless
inetd.conf if the script dies between the calls, or (b) call
inetd.conf too early, before your programs are configured to be

Note that you can do the following if the former is the case:

cp /etc/inetd.conf /etc/inetd.conf.samba
update-inetd --file /etc/inetd.conf.samba --other-options ...
update-inetd --file /etc/inetd.conf.samba --other-options ...
mv /etc/inetd.conf.samba /etc/inetd.conf

In that way, you never touch /etc/inetd.conf until your new version is
completely ready.



  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
             Debian GNU/Linux Developer.  jdg@debian.org
       -*- Finger jdg@master.debian.org for my PGP public key. -*-

Reply to: