Server and client ports now available on FreeBSD

Hello, I have built FreeBSD ports for the server and the client components of UrBackup, complete with rc scripts for startup/shutdown. These were committed to the ports tree today under archivers/urbackup-server and archivers/urbackup-client. For reference, here are their port detail pages on freshports.org:


I welcome any feedback if you see something that you think should be changed in future iterations of the ports.

1 Like

Very cool!

I guess that means the FreeNAS installation instructions ( https://www.urbackup.org/freenasserverinstall.html ) can be simplyfied. Correct? There is probably a problem with getting it to run as root, now that I look at it…

I’ve never used FreeNAS, but since its jails appear to include the FreeBSD ports tree (https://doc.freenas.org/9.3/freenas_jails.html) I would imagine it would be as simple as “cd /usr/ports/archivers/urbackup-server && make install” or “pkg install urbackup-server” (once the binary packages hit the repos).

The port creates a urbackup user and group, and the server runs as that user. I think that would work fine in the FreeNAS jail environments as well. Is there a reason it needs to run as root on FreeNAS?

Note that the port does install the urbackup_mount_helper and urbackup_snapshot_helper with the SUID/SGID bits set.

It didn’t have a stable uid/gid, but I guess with the package it does. Still might be slightly bad switching now :wink: Maybe you could add a parameter -c /path/to/config to the next iteration and add a default config file like urbackup_backend/defaults_server at dev · uroni/urbackup_backend · GitHub urbackup_backend/defaults_client at dev · uroni/urbackup_backend · GitHub

If installed from the ports, it will have UID/GID 891, as defined in /usr/ports/{UIDs,GIDs}.

I’ll look into adding the default configs in a future iteration.

Another thing w.r.t. server config: If you don’t specify LOG_ROTATE_FILESIZE=bytes ( and LOG_ROTATE_NUM=10) or the respective command line arguments. The log file will grow infinitely if it is not integrated with logrotate ( https://github.com/uroni/urbackup_backend/blob/dev/logrotate_urbackupsrv )

I had noticed the large log files on my own installation, and added a newsyslog file to address that (/usr/local/etc/newsyslog.conf.d/urbackup.conf):

# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/urbackup.log urbackup:urbackup 644 5 1000 * JC

I was thinking of adding this file to the port, but perhaps I’ll just insert the LOG_ROTATE_FILESIZE and LOG_ROTATE_NUM parameters into the default config when I add it. Any preference on the default filesize?

I’ve got a draft port revision ready (for the server) that adds a default configuration file (%%PREFIX%%/etc/urbackup/urbackupsrv.conf). However, in my testing the log rotation parameters don’t appear to be having any effect. With respect to logging, my test configuration file includes:

#log file name
LOGFILE="/var/log/urbackup-server.log"

#Either debug,warn,info or error
LOGLEVEL=“warn”

#Size at which to rotate the log (bytes)
LOG_ROTATE_FILESIZE=10000

#Number of log files to keep
LOG_ROTATE_NUM=10

The daemon has been running with this config for several days, and the log file has grown to 5MiB with no rotation. Am I doing something wrong here?

(You’ll note that I changed the filename for the log file–this was just for testing, in order to make sure the config file was actually being used by urbackupsrv. I plan to change it back to urbackup.log in the final port revision. Also, once log rotation is working, I’ll probably make the default log rotate size 1,000,000 bytes)

One reason could be that it does not have permissions to create files in /var/log as urbackup user.

(Now that I remember that it is another reason to prefer the logrotate approach.)

Good day! Thank you for providing ports, it’s great! I’ve moved my server from Linux to FreeBSD. At the same time I faced a problem that was not on Linux. When a file backup is performed, the job ends with warnings like “HT: error when creating a hard link with … Operation not permitted (code: 1)”. And when you perform an incremental backup, its size is comparable to the full backup. As if hard links are not used at all… I use ZFS as a backend.

FYI…a port update was just published that adds a default config and log rotation. I’ll look into the ZFS issues.