I've done a lot of digging into this, and while I have not solved it yet, I want to document in case anyone else runs into this problem and finds this through archives of this mailing list.
First off, this is an issue introduced with the recently released Ubuntu 26.04 LTS. I fired up a spare machine that had 24.04 LTS running on it, and all I had to do was "sudo apt install apache2" and "sudo apt install backuppc", start both with systemctl and was instantly up and running, with no problems modifying the configuration files. If I don't get this figured out I may just go and load 24.04 on my backuppc server box, but would prefer to be more up to date. As of last weekend, I was thinking there had been a disk error since mounting an external file system allowed things to work. The revision to the /usr/share/backuppc/lib/BackupPC/Storage/Text.pm file, which I did based on this search find: Can not edit config.pl and open log file in web Interface · Issue #188 · backuppc/backuppc <https://github.com/backuppc/backuppc/issues/188> provided a more expansive error message indicating that the file system was read-only: --- TextFileWrite: Failed to write /etc/backuppc/localhost.pl.new (errno = Read-only file system, uids = 33,113, gids = 33 33,33 33, umask = 027, ver = v5.40.1, prog = /usr/bin/perl) --- (note uid and gid 33 are both www-data and uid 113 is backuppc). So I went down a rabbit hole of disk diagnostics. Smartmontools indicated I *may* have a problem, even though the disk "passed" so I reformatted the partition with mkfs flags that ran a destructive badblocks command (writes to every block multiple times to cause any bad blocks to get remapped). Yes, excessive. Took days to run. Reinstalled everything (no indications of any bad blocks this time around), and I got the exact same results. --- username@backuppc:/mnt$ ls -la /etc/backuppc/ total 212 drwxrwxr-x 2 backuppc www-data 4096 May 29 09:24 . drwxr-xr-x 142 root root 12288 May 29 10:24 .. -rw-r----- 1 backuppc backuppc 0 May 30 11:00 LOCK -rw-r--r-- 1 backuppc www-data 835 May 29 09:24 apache.conf -rw-rw-r-- 1 backuppc www-data 88554 Feb 2 15:19 config.pl -rw-rw-r-- 1 backuppc www-data 88392 Feb 2 15:19 config.pl.sample -rw-rw-r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts -rw-rw-r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts.sample -rw-r----- 1 backuppc www-data 47 May 29 09:09 htpasswd -rw-rw-r-- 1 backuppc www-data 427 Feb 2 15:19 localhost.pl lrwxrwxrwx 1 root root 13 May 28 22:46 pc -> /etc/backuppc username@backuppc:/mnt$ ls -la /mnt/sdb2 total 220 drwxrwxr-x 3 backuppc www-data 4096 May 29 09:24 . drwxr-xr-x 3 root root 4096 May 30 11:13 .. -rw-r----- 1 backuppc backuppc 0 May 30 11:00 LOCK -rw-r--r-- 1 backuppc www-data 835 May 29 09:24 apache.conf -rw-rw-r-- 1 backuppc www-data 88554 Feb 2 15:19 config.pl -rw-rw-r-- 1 backuppc www-data 88392 Feb 2 15:19 config.pl.sample -rw-rw-r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts -rw-rw-r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts.sample -rw-r----- 1 backuppc www-data 47 May 29 09:09 htpasswd -rw-rw-r-- 1 backuppc www-data 427 Feb 2 15:19 localhost.pl drwx------ 2 root root 16384 May 30 11:12 lost+found lrwxrwxrwx 1 root root 13 May 28 22:46 pc -> /etc/backuppc username@backuppc:/mnt$ sudo umount /mnt/sdb2 username@backuppc:/mnt$ sudo mount /dev/sdb2 /etc/backuppc username@backuppc:/mnt$ ls -la /etc/backuppc/ total 228 drwxrwxr-x 3 backuppc www-data 4096 May 29 09:24 . drwxr-xr-x 142 root root 12288 May 29 10:24 .. -rw-r----- 1 backuppc backuppc 0 May 30 11:00 LOCK -rw-r--r-- 1 backuppc www-data 835 May 29 09:24 apache.conf -rw-rw-r-- 1 backuppc www-data 88554 Feb 2 15:19 config.pl -rw-rw-r-- 1 backuppc www-data 88392 Feb 2 15:19 config.pl.sample -rw-rw-r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts -rw-rw-r-- 1 backuppc www-data 2243 Feb 2 15:19 hosts.sample -rw-r----- 1 backuppc www-data 47 May 29 09:09 htpasswd -rw-rw-r-- 1 backuppc www-data 427 Feb 2 15:19 localhost.pl drwx------ 2 root root 16384 May 30 11:12 lost+found lrwxrwxrwx 1 root root 13 May 28 22:46 pc -> /etc/backuppc username@backuppc:/mnt$ --- Here I check the permissions of /etc/backuppc as it exists on the main file system (note, I had already added write permissions to group to several of the files in this directory but that didn't solve anything. As you can see, the permissions of the /etc/backuppc directory are drwxrwxr-x backuppc www-data (rw for both the user and group). And the config files, other than apache.conf and htpasswd are also rw for both user (backuppc) and group (www-data). Then I mounted a file system to which I had previously copied over the contents of /etc/backuppc, using rsunc to preserve all attributes ("sudo rsync -av /etc/backuppc/ /mnt/sdb2"). I had temporarily mounted this at /mnt/sdb2 to do the copying. I unmounted it from there and then mounted it on /etc/backuppc. As you can see, it had the exact same contents and permissions (plus it had a lost+found directory). Using the "native" /etc/backuppc, I got the "failed to write" error. After mounting the separate-disk /etc/backuppc I got no error message. I have tried G.W.'s suggestion to change $Conf{UmaskMode} in BackupPC's config.pl to 007 from 027 but this made no difference. Both G.W. and tomas's suggestion that this is apparmor causing problems, but I dug into that and it doesn't look like there is any problems. I searched the logs running "sudo journalctl | grep apparmor | grep backuppc" and got nothing other than "backuppc being the name of the computer. I also looked through /etc/apparmor.d directory and there is nothing there for apache2 nor backuppc. So I am still stuck. I must be the first person to try to install backuppc on the new Ubuntu, or else everyone else is way smarter than me and figured this out on their own. Maybe I should file a bug report with Ubuntu. On Mon, May 25, 2026, at 11:36 AM, G.W. Haywood wrote: > Hi there, > > On Sun, 24 May 2026, backuppc@sundquist... wrote: > > > ... > > I reinstalled Apache2 and backuppc. > > ... > > That was probably excessive. Did you see my private mail? > > 8<---------------------------------------------------------------------- > > Date: Fri, 15 May 2026 08:59:25 +0100 (BST) > From: G.W. Haywood <[email protected]> > To: [email protected] > Subject: Re: Fresh install (ubuntu) permissions issues > > 8<---------------------------------------------------------------------- > > > One commenter ... had SELinux running and had to write a policy > > ... I don't have SELinux running. > > On Ubuntu I think it's more likely to be AppArmor than SELinux. > > > ... One respondent provided some code to add to .../Storage/Text.pm > > to get more info on the error. I did this and got ... > > --- > > TextFileWrite: Failed to write /etc/backuppc/localhost.pl.new \ > > (errno = Read-only file system, uids = 33,113, gids = 33 33,33 33, > > umask = 027, ver = v5.40.1, prog = /usr/bin/perl) > > --- > > ... > > ... the read-only file system message, .. didn't make sense ... > > Unless there really is a problem with the filesystem, which is quite > possible but seems to me unlikely, I wonder if that might just be a > misleading error message. Can you point me to the code that you used > to modify your Text.pm? > > > ... plugged in an external drive with a fresh ext4 partition. Did a > > temporary mount and copied over the contents of /etc/backuppc, then > > remounted it at /etc/backuppc. > > > > And it worked! So I must have some bad blocks where /etc/backuppc > > was in the original installation. > > There could be an alternative explanation for the symptoms. I'm > wondering if the /etc/backuppc directory in your temporary mount > doesn't have the same permissions as those in the original mount. > That might explain why you could write to the temporary mount. If > that's the case then, the problem might be $Conf{UmaskMode} in your > BackupPC's config.pl. Take a look at that value (it's expressed as > octal digits, they will be 027) and also at > > perldoc -f umask > > I think perhaps it's the *process* permissions which are too tight for > your setup, not those of files/directories in the filesystem. > > You could try changing $Conf{UmaskMode} from 027 to 007 in config.pl. > > If there is any temporary '.new' file hanging around after a previous > attempt then if it does not have group write permission you will want > to delete it before trying again - I'm not sure that BackupPC will > change the permissions of an existing file. > > -- > > 73, > Ged. > > > _______________________________________________ > BackupPC-users mailing list > [email protected] > List: https://lists.sourceforge.net/lists/listinfo/backuppc-users > Wiki: https://github.com/backuppc/backuppc/wiki > Project: https://backuppc.github.io/backuppc/ >
_______________________________________________ BackupPC-users mailing list [email protected] List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: https://github.com/backuppc/backuppc/wiki Project: https://backuppc.github.io/backuppc/
