From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Apr 17 16:40:03 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE2521065679 for ; Fri, 17 Apr 2009 16:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C84258FC1B for ; Fri, 17 Apr 2009 16:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HGe3oM026463 for ; Fri, 17 Apr 2009 16:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n3HGe3h2026462; Fri, 17 Apr 2009 16:40:03 GMT (envelope-from gnats) Resent-Date: Fri, 17 Apr 2009 16:40:03 GMT Resent-Message-Id: <200904171640.n3HGe3h2026462@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Kostas Voulgaris Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAFDC106564A for ; Fri, 17 Apr 2009 16:38:33 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id BDCEE8FC0C for ; Fri, 17 Apr 2009 16:38:33 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HGcWlK058621 for ; Fri, 17 Apr 2009 16:38:32 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n3HGcW2i058614; Fri, 17 Apr 2009 16:38:32 GMT (envelope-from nobody) Message-Id: <200904171638.n3HGcW2i058614@www.freebsd.org> Date: Fri, 17 Apr 2009 16:38:32 GMT From: Kostas Voulgaris To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/133818: bacula-server-2.4.2: make_sqlite_tables sets wrong permmisions to db file X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2009 16:40:04 -0000 >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: