I can reproduce when running debootstrap from cron.
Use the attached script to reproduce:
1) Add debootstrap and chroot to sudoers as NOPASSWD:
user host=NOPASSWD: /usr/sbin/chroot
user host=NOPASSWD: /usr/sbin/debootstrap
2) Run attached script via cron
3) Script fails with the following error:
[...]
chgrp: cannot access `/etc/ssl/private/ssl-cert-snakeoil.key': No such
file or directory
chmod: cannot access `/etc/ssl/private/ssl-cert-snakeoil.key': No such
file or directory
dpkg: error processing ssl-cert (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
ssl-cert
E: Sub-process /usr/bin/dpkg returned an error code (1)
(Step 4: Clean up sudoers if desired)
The patch I attached in comment #7 fixes the problem for me.
I can reproduce when running debootstrap from cron.
Use the attached script to reproduce: debootstrap private/ ssl-cert- snakeoil. key': No such private/ ssl-cert- snakeoil. key': No such
1) Add debootstrap and chroot to sudoers as NOPASSWD:
user host=NOPASSWD: /usr/sbin/chroot
user host=NOPASSWD: /usr/sbin/
2) Run attached script via cron
3) Script fails with the following error:
[...]
chgrp: cannot access `/etc/ssl/
file or directory
chmod: cannot access `/etc/ssl/
file or directory
dpkg: error processing ssl-cert (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
ssl-cert
E: Sub-process /usr/bin/dpkg returned an error code (1)
(Step 4: Clean up sudoers if desired)
The patch I attached in comment #7 fixes the problem for me.