Yesterday I ran into a situation where I tried to create a new postfix
instance, but the *.proto files where missing (i.e. they were there, but in
the wrong place):

# postmulti -I postfix-test -e create
cp: cannot stat '/etc/postfix/main.cf.proto': No such file or directory

Nevertheless the directories were created:

# ls -ld /etc/postfix-test/ /var/lib/postfix-test/ /var/spool/postfix-test/
drwxr-xr-x 3 root root 4096 24. Sep 08:39 /etc/postfix-test/
drwx------ 2 root root 4096 24. Sep 08:39 /var/lib/postfix-test/
drwxr-xr-x 2 root root 4096 24. Sep 08:39 /var/spool/postfix-test/

But when I tried to remove them, postmulti claimed there wasn't an instance
named postfix-test:

# postmulti -i postfix-test -e destroy
postmulti: fatal: No instance named postfix-test

This left me in a kind of deadlock and I had to remove the directories
manually.

I think there should be a 'better way' to handle this. What comes to mind is:

- Test if the required files are present. Create the instance if they are
  present. Do not create the instance if they are absent and tell so.

- Delete the instance if the directories are present.

I can't tell which is better or if there's another approach that handles such
a situation even more gracefully. But I think the current way to handle this
should be improved.

p@rick

P.S:
And yes, I told the package maintainer about the missing files:
https://bugs.gentoo.org/show_bug.cgi?id=561278

-- 
[*] sys4 AG
 
https://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München
 
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein
 

Reply via email to