Package Details: urbackup-server 1.4.14-2

Git Clone URL: https://aur.archlinux.org/urbackup-server.git (read-only)
Package Base: urbackup-server
Description: Client Server backup system
Upstream URL: http://www.urbackup.org/
Licenses: GPL
Conflicts: urbackup2-server
Submitter: kirpich
Maintainer: k0n24d
Last Packager: k0n24d
Votes: 4
Popularity: 0.009094
First Submitted: 2012-05-12 17:58
Last Updated: 2016-06-18 15:48

Latest Comments

k0n24d commented on 2016-02-20 10:15

@nhrjr
thanks for the comment. Fixed.

nhrjr commented on 2016-02-20 09:08

makepkg now throws an error, because the install line contains parantheses.

k0n24d commented on 2015-12-06 15:42

@Sagattarii

thanks updated and added fuse as dependency

Sagattarii commented on 2015-12-02 18:45

I think you have to add "fuse" to the dependencies. On a fresh installed arch linux configuring failed. I had to install fuse to compile it.

And you install the files with chmod 755 instead of 644.

skurk commented on 2015-06-25 10:50

@k0n24d - I must admit that I have not read all the documentation and the entire startup script in details. I mostly posted what I did to make it work without issues. On my system the server did not start at boot in it's unmodified form. Rather it timed out and entered a failed state with the aforementioned error "PID file /run/urbackup_srv.pid not readable (yet?).

I have just replaced my modified files with the originals from the package and I am now unable to reproduce the exact error. The server seems to be starting just fine, the web UI is however not reachable after boot. The server cannot be restarted manually either, instead it exits with a SIGTERM after a time out. Also waiting for network-online.target doesn't really seem to matter after some more investigation, just like you said it seems it binds to 'any' interface.
The only thing that consistently makes the server start at boot AND be reachable without restart is to make sure the PID-file is readable before starting the server.

This might be just for me and my tiny server (perhaps it is cause it boots in just a few seconds), but I am unable to get it to work with the default service file. If I start the server manually without specifying the PID-file it seems to start and work just fine. So... Fatal error or not. In my case it is fatal and needs a workaround, dirty or not :-)

I apologize if it wasn't relevant for most people. Keep Arching!

k0n24d commented on 2015-06-08 09:37

@skurk also please not that

"PID file /run/urbackup_srv.pid not readable (yet?) after start."

Is not fatal. Systemd will find the pidfile later on:

● urbackup-server.service - UrBackup Client/Server Network Backup System
Loaded: loaded (/usr/lib/systemd/system/urbackup-server.service; disabled; vendor preset: disabled)
Active: active (running) since lun. 2015-06-08 11:13:14 CEST; 18min ago
Process: 24629 ExecStart=/usr/sbin/start_urbackup_server (code=exited, status=0/SUCCESS)
Main PID: 24636 (urbackup_srv)
CGroup: /system.slice/urbackup-server.service
└─24636 /usr/sbin/urbackup_srv --daemon --plugin /usr/lib/liburbackupserver_urlplugin.so --plugin /usr/lib/liburbackupserver_cryptoplugin.so --plugin /usr/lib/liburbackupserver_fsimageplugin.so --plugin /usr/lib/liburbackupserver.so --http_root /var/urbackup/www --workingdir /var --snapshot_helper /usr/bin/urbackup_snapshot_helper --plugin /usr/lib/liburbackupserver_httpserver.so --port 55413 --logfile /var/log/urbackup.log --loglevel warn --http_port 55414 --pidfile /var/run/urbackup_srv.pid --user urbackup

juin 08 11:13:14 yyyy systemd[1]: Starting UrBackup Client/Server Network Backup System...
juin 08 11:13:14 yyyy systemd[1]: PID file /run/urbackup_srv.pid not readable (yet?) after start.
juin 08 11:13:14 yyyy systemd[1]: Started UrBackup Client/Server Network Backup System.

cat /run/urbackup_srv.pid
24636

ps auxwww | urbackup_srv
urbackup 24636 0.0 0.1 528120 15132 ? Sl 11:13 0:00 /usr/sbin/urbackup_srv --daemon --plugin /usr/lib/liburbackupserver_urlplugin.so --plugin /usr/lib/liburbackupserver_cryptoplugin.so --plugin /usr/lib/liburbackupserver_fsimageplugin.so --plugin /usr/lib/liburbackupserver.so --http_root /var/urbackup/www --workingdir /var --snapshot_helper /usr/bin/urbackup_snapshot_helper --plugin /usr/lib/liburbackupserver_httpserver.so --port 55413 --logfile /var/log/urbackup.log --loglevel warn --http_port 55414 --pidfile /var/run/urbackup_srv.pid --user urbackup

k0n24d commented on 2015-06-08 09:32

@skurk Thanks for pointing these issues out. But I must admit I do not fully agree with your changes - but I'm open to discuss this as I might be wrong ;-)

Regarding /run and /var/run as of https://wiki.archlinux.org/index.php/Arch_filesystem_hierarchy#.2Frun:_Ephemeral_runtime_data /var/run should be a symlink to /run.

Which is indeed a temp fs but I do not understand why that leads to the rest of your changes - like wanting to execute start_urbackup_server as user urbackup ? It is supposed to be run as root which is what permits urbackup_srv among other things to create the pidfile - it then drops privileges to the urbackup user.

So this should not be an issue. Neverless I admit it's not clean. But I think it's better to make the minimum changes to what's provided by upstream: urbackup-server.service and start_urbackup_server are provided in the source file. So I believe it would be better to file a bug upstream.

Regarding your change from network.target to network-online.target: It is strongly recommended not to pull in this target too liberally: for example network server software should generally not pull this in (since server software generally is happy to accept local connections even before any routable network interface is up), it's primary purpose is network client software that cannot operate without network. [see http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/]

k0n24d commented on 2015-06-08 09:32

Regarding /run and /var/run as of https://wiki.archlinux.org/index.php/Arch_filesystem_hierarchy#.2Frun:_Ephemeral_runtime_data /var/run should be a symlink to /run.

Which is indeed a temp fs but I do not understand why that leads to the rest of your changes - like wanting to execute start_urbackup_server as user urbackup ? It is supposed to be run as root which is what permits urbackup_srv among other things to create the pidfile - it then drops privileges to the urbackup user.

So this should not be an issue. Neverless I admit it's not clean. But I think it's better to make the minimum changes to what's provided by upstream: urbackup-server.service and start_urbackup_server are provided in the source file. So I believe it would be better to file a bug upstream.

Regarding your change from network.target to network-online.target: It is strongly recommended not to pull in this target too liberally: for example network server software should generally not pull this in (since server software generally is happy to accept local connections even before any routable network interface is up), it's primary purpose is network client software that cannot operate without network. [see http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/]

skurk commented on 2015-06-06 08:53

There are some problems with the PID file and systemd service. The first problem is that the PID-file locations are different in the service file and the launch script:

urbackup-server.service = PIDFile=/run/urbackup_srv.pid
start_urbackup_server = PIDFILE="/var/run/urbackup_srv.pid"

This is one of the reasons the server refuses to start and gives the error:
"PID file /run/urbackup_srv.pid not readable (yet?) after start."

The other reason is that /run is a temporary filesystem in Arch so we need to either specify RuntimeDirectory= and RuntimeDirectoryMode= to create the PID-file as user urbackup under $XDG_RUNTIME_DIR (/run/user/UID/), or create and chown a directory for the PID-file under /var/run/ using the systemd service file like so:

[Unit]
Description=UrBackup Client/Server Network Backup System
# If using NetworkManager network-online.target waits until
# network is online and the urBackup server is reachable after
# boot without restarting the service
After=syslog.target network-online.target

[Service]
Type=forking
# Need to specify user and group for PermissionStartOnly to work
User=urbackup
Group=urbackup
NotifyAccess=all
# Execute everything but ExecStart as 'root'
PermissionsStartOnly=true
# Create and chown dir under /var/run to store PID-file for user urbackup
# The dash (-) before mkdir ignores errors
ExecStartPre=-/usr/bin/mkdir /var/run/urbackup
ExecStartPre=/usr/bin/chown -R urbackup:urbackup /var/run/urbackup
# The following is run as user 'urbackup'
ExecStart=/usr/sbin/start_urbackup_server
PIDFile=/var/run/urbackup/urbackup_srv.pid

[Install]
WantedBy=multi-user.target

skurk commented on 2015-06-06 08:34

Since /run is a tempfs in Arch the post-install chown for the pidfile is not working as intended. Also the PID-file locations are different in the service file and the launch script:

urbackup-server.service = PIDFile=/run/urbackup_srv.pid
start_urbackup_server = PIDFILE="/var/run/urbackup_srv.pid"

This is one of the reasons the server refuses to start and journalctl status -l urbackup-server says "PID file /run/urbackup_srv.pid not readable (yet?) after start."

The other reason is that /run is a temporary filesystem in Arch so we need to either specify RuntimeDirectory= and RuntimeDirectoryMode= to create the PID-file as user urbackup under $XDG_RUNTIME_DIR (/run/user/UID/), or create and chown a directory for the PID-file under /var/run/ using the systemd service file like so:

[Unit]
Description=UrBackup Client/Server Network Backup System
After=syslog.target network.target

[Service]
Type=forking
// Need to specify user and group for PermissionStartOnly to work
User=urbackup
Group=urbackup
NotifyAccess=all
// Execute everything but ExecStart as root
PermissionsStartOnly=true
// Create and chown dir under /var/run to store PID-file for user urbackup
ExecStartPre=-/usr/bin/mkdir /var/run/urbackup // Create a directory (- ignores errors)
ExecStartPre=/usr/bin/chown -R urbackup:urbackup /var/run/urbackup
ExecStart=/usr/sbin/start_urbackup_server
PIDFile=/var/run/urbackup/urbackup_srv.pid

[Install]
WantedBy=multi-user.target

All comments