In the subroutine setup_po (), there are two separate step for the update process :
First Step :
The objective of the first step is to backup the current production files (authdaemonrc userdb) if they exist in the directory /etc/courier. This step must not fail even if the files do not exist.
Second Step :
The goal of the second step is the configuration file regeneration. For this, I assumed that the user must have previously backed up file
/etc/ispcp/courier/backup/authdaemonrc.system. Of course, if the file does not exist, the process returns an error.
Unfortunately, as regards the file
authdaemonrc there are not many alternatives since this file is not provided by ispCP. Thus, if the user makes mistakes and that this file is not present (for some reason), we can not do anything other than return an error.
Regarding your advice to read the file previously saved in the first state (
authdaemonrc.$timestamp) is a solution that can be adopted.
In fact, I did not choose this solution because I wanted to re-build the file from the file authdaemonrc.system whose state is the same as that provided by the Debian package.
For the future, I think we'll provide our own
autdhaemonrc file with ispCP. This will avoid mistakes during update process.
What I do not understand is that you say on your system, the
/etc/ispcp/courier/backup does not exist. But normally, it is automatically created during the make process, whether an update or installation:
State of
/tmp/ispcp/etc/ispcp/courier after the make process:
Code:
ispcp:/tmp/ispcp# tree /tmp/ispcp/etc/ispcp/courier
/tmp/ispcp/etc/ispcp/courier/
|-- backup
| `-- empty-file
|-- userdb
`-- working
`-- empty-file
2 directories, 3 files