Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Apr 2009 16:38:32 GMT
From:      Kostas Voulgaris <voulgaris@ceid.upatras.gr>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/133818: bacula-server-2.4.2: make_sqlite_tables sets wrong permmisions to db file
Message-ID:  <200904171638.n3HGcW2i058614@www.freebsd.org>
Resent-Message-ID: <200904171640.n3HGe3h2026462@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         133818
>Category:       ports
>Synopsis:       bacula-server-2.4.2: make_sqlite_tables sets wrong permmisions to db file
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 17 16:40:03 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Kostas Voulgaris
>Release:        7.1-RELEASE
>Organization:
>Environment:
FreeBSD srv.kcyber.dyndns.org 7.1-RELEASE-p4 FreeBSD 7.1-RELEASE-p4 #0: Sun Mar 22 12:35:36 UTC 2009     root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The script /usr/local/share/bacula/make_sqlite_tables that creates the sqlite database file in /var/db/bacula/bacula.db (default path) should set the file's owner to bacula and group to bacula instead of root:bacula. If not the bacula director (runs as user bacula) cannot write to the database. The problem[1] and the solution[2] is described in bacula-users mailing list and exists since 2007 but noone has reported it yet.

The problem is noticed when trying to run any configured backup job. You get errors when trying to insert data in database like this one: 

14-Apr 18:06 srv-dir JobId 0: Fatal error: sql_create.c:524 sql_create.c:524 insert INSERT INTO Client (Name,Uname,AutoPrune,FileRetention,JobRetention) VALUES ('spooky-fd','',1,2592000,15552000) failed:
attempt to write a readonly database
14-Apr 18:06 srv-dir JobId 0: sql_create.c:524 INSERT INTO Client (Name,Uname,AutoPrune,FileRetention,JobRetention) VALUES ('spooky-fd','',1,2592000,15552000)
14-Apr 18:06 srv-dir JobId 0: Error: sql_create.c:526 Create DB Client record INSERT INTO Client (Name,Uname,AutoPrune,FileRetention,JobRetention) VALUES ('spooky-fd','',1,2592000,15552000) failed. ERR=attempt to write a readonly database
14-Apr 18:06 srv-dir JobId 0: Fatal error: Could not create Client record. ERR=sql_create.c:526 Create DB Client record INSERT INTO Client (Name,Uname,AutoPrune,FileRetention,JobRetention) VALUES ('spooky-fd','',1,2592000,15552000) failed. ERR=attempt to write a readonly database

----

[1] http://www.mail-archive.com/bacula-users@lists.sourceforge.net/msg21700.html
[2] http://www.mail-archive.com/bacula-users@lists.sourceforge.net/msg21725.html
>How-To-Repeat:
i) install bacula-server-2.4.2
ii) run /usr/local/share/bacula/make_sqlite_tables to initialize the database
iii) run any backup job
>Fix:
The command:

  chown bacula:bacula ${db_name}.db

should be appended at the make_sqlite_tables script.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904171638.n3HGcW2i058614>