install URbackup in a jail

hervon

Patron
Joined
Apr 23, 2012
Messages
353
Works great on 9.3. Updated to urbackup to 1.4.7 without issue.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
Just tried installing this and the service won't start. I'm getting this error:

Code:
/etc/rc.conf: 10: Syntax error: Unterminated quoted string
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353
Just tried installing this and the service won't start. I'm getting this error:

Code:
/etc/rc.conf: 10: Syntax error: Unterminated quoted string

Check the rc.conf text file : maybe a quote (") is missing or something.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
It was and I just fixed that. Now I'm getting a new error and this one doesn't make sense at all:

Code:
env: /etc/rc.d/urbackup_srv: No such file or directory


It doesn't make sense because the file is there. I created it and ftp'd in to double check that it's there and it is.
 
Last edited:

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
Well I managed to get it running but now I can't open the web UI. Says page not found. :(

When I try to restart the service it looks like something is hanging. This is what I get in putty when I restart it. It seems to stop right there.

 
Last edited:

dasti

Explorer
Joined
Jun 11, 2014
Messages
71

gdarends

Explorer
Joined
Jan 20, 2015
Messages
72
actually I don see any reason why it should not work :)

I thought I read somewhere that the plugin system changed since version 9.3. Maybe I misread.
 

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
Hum, I´m not aware of that change. Actually this installation is not using the plugin

I´ll update this post as soon as I have the time to test that details
Iĺl have also to check if the next version of the plugins works
 

dannysatch

Cadet
Joined
Feb 18, 2015
Messages
1
Hey,

Just wanted to say thanks for creating the guide. I've just successfully tested this method on FreeNAS 9.3 running in VirtualBox. Backed up and restored a Server 2012 R2 Domain Controller also running in VirtualBox.

Works very nicely. Just need to make some time to get this running on our production server.

Thanks again.
 

robesau

Cadet
Joined
Mar 25, 2015
Messages
3
The publisher of the sosftware has a PBI for 1.4.8 that works on FreeNAS-9.3-STABLE-201503170439 but I cannot get the pbi to run on a server running FreeNAS-9.3-STABLE-201503071634,

going to update and see if it works after that.
 

robesau

Cadet
Joined
Mar 25, 2015
Messages
3
updated to FreeNAS-9.3-STABLE-201503200528 and the pbi that is supplied by URbackup still unable to start. going to try a manual install and see if it works on the most recent release
 

robesau

Cadet
Joined
Mar 25, 2015
Messages
3
installed using this guide with the latest version of 1.4.8 and everything is working just doing my first backup to the server right now.
 

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
nice to hear that !
I had the same kind of problems with the .pbi, that's why I compiled this guide !
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,458
Thanks for this guide--it's very helpful and I've been able to get Urbackup 99% up and running on my FreeNAS 9.3-STABLE system. I have a couple of suggestions that might improve the guide:
  • If you use the -w flag for nano, it won't insert line breaks and mess up line 6 of your script. "nano -w urbackup_srv"
  • Although there's a little bit of discussion of this in the thread, it'd probably be good to create a dataset for the backups, and mount it as storage for the urbackup jail--it keeps with the FreeNAS way of separating the OS (in this case the jail) from its data
  • You're missing a closing quote mark from your edit to /etc/rc.conf
  • As I understand it (though I'm certainly not a FreeBSD guru), it's the "FreeBSD way" to put anything that isn't part of the OS distribution in /usr/local. This would mean that the startup script would go in /usr/local/etc/rc.d, and the edits would be made to /usr/local/etc/rc.conf
The fourth bullet point is the 1% that isn't working quite right for me. I put the urbackup_srv script in /usr/local/etc/rc.d, and added 'urbackup_srv_enable="YES"' to /usr/local/etc/rc.conf. When I try to start the service, I get this:
Code:
[root@urbackup /usr/local/etc/rc.d]# service urbackup_srv start
/usr/local/etc/rc.d/urbackup_srv: WARNING: $urbackup_srv_enable is not set properly - see rc.conf(5).
Cannot 'start' urbackup_srv. Set urbackup_srv_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.

I'm able to start it just fine with 'onestart', and the service runs and backs up clients without issues.
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353
danb35, I just tried to start the service and it works just fine. I did not use the usr/local/ folder though.

I put the rc.conf file in this folder : Urbackup/etc/
I put the urbackup_srv script in this folder : Urbackup/etc/rc.d

This way, I updated urbackup from 1.4.6 to 1.4.7 then 1.4.8 easily only doing the steps 5 and 6 in the tutorial. Hope that helps. Works 100% for me. Urbackup is awesome!
 

dasti

Explorer
Joined
Jun 11, 2014
Messages
71

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
Hi danb35 !

thanks for your great feedback !!! that's what I needed !


If you use the -w flag for nano, it won't insert line breaks and mess up line 6 of your script. "nano -w urbackup_srv"

-->> guide updated, I changed the method using echo .... to paste the line directly

Although there's a little bit of discussion of this in the thread, it'd probably be good to create a dataset for the backups, and mount it as storage for the urbackup jail--it keeps with the FreeNAS way of separating the OS (in this case the jail) from its data

-->> I aggree, I finally found how to do this !, guide updated

You're missing a closing quote mark from your edit to /etc/rc.conf

-->> I corrected the mistake !

As I understand it (though I'm certainly not a FreeBSD guru), it's the "FreeBSD way" to put anything that isn't part of the OS distribution in /usr/local. This would mean that the startup script would go in /usr/local/etc/rc.d, and the edits would be made to /usr/local/etc/rc.conf

We are a bit over my head here :) but let's try :
- I noticed on other guides that the startup files are usually in /usr/local/etc/rc.d , but I still don't understand why. To be honest for me there are a lot of etc (and others) directories all over the place and I still don't get the philosophy behind that, if you have good reading on that...
- from what's I've seen, editing rc.conf is always in /etc/rc.conf but you might also be right !!

- for now, I changed the guide
- for the startup script to be in /usr/local/etc/rc.d
- the editing of rc.conf in /etc/rc.conf

for now but I can't test it, I hope I didn't introduce a bug...I need a bit of help from to test validate that point​
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,458
The proper use of /usr/local/ is a little advanced for me as well. When I edited /etc/rc.conf, with the startup script in /usr/local/etc/rc.d/, the urbackup_srv service starts and stops properly.

Another thing that would be good, though it probably isn't necessary, is to create a urbackup user on the FreeNAS system, and set the numeric userids on that account and the urbackup account inside the jail, to match. That way, you can have the dataset owned by that user, and have fairly restrictive permissions for it if you like. That would also show the urbackup process(es) under that user in top and other system monitoring tools. To do this, within the jail, run
Code:
# pw usermod urbackup -u 936
# pw usermod urbackup -g 936
# pw groupmod urbackup -g 936
# chown -R urbackup:urbackup /usr/local/var/urbackup


Then, using the FreeNAS web GUI, create a new user account. Set the user ID to 936 (a number I chose mostly at random; I'm certainly open to suggestions of a better one), the name to urbackup, the full name to Urbackup User (or whatever you want), and check the box to disable password login. Save the user.

Then go to storage, find the urbackup dataset, and edit the permissions. Change them to be owned by the urbackup user and group, and check the box to apply them recursively.

Then restart the urbackup_srv service inside the jail, and you should be set.
 

andrewjs18

Contributor
Joined
Oct 19, 2014
Messages
141
Hi,

first, thanks for the tutorial, it's very detailed and I certainly appreciate that.

I'm at step 8 in the tutorial - I assume I can name my backup dataset whatever I want, correct?
 

dasti

Explorer
Joined
Jun 11, 2014
Messages
71
Hi,

first, thanks for the tutorial, it's very detailed and I certainly appreciate that.

I'm at step 8 in the tutorial - I assume I can name my backup dataset whatever I want, correct?
yes no problem, you just have to adapt the command that refers to it
 
Top