diff --git a/opam b/opam index c62a91004..6f968d62f 100644 --- a/opam +++ b/opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "ocsigenserver" -version: "2.12.0" +version: "2.13.0" maintainer: "dev@ocsigen.org" synopsis: "A full-featured and extensible Web server." description: "Ocsigen Server implements most features of the HTTP protocol, and has a very powerful extension mechanism that makes it very easy to plug your own OCaml modules for generating pages. Many extensions are already implemented, like a reverse proxy, content compression, access control, authentication, etc." diff --git a/src/baselib/ocsigen_config.ml.in b/src/baselib/ocsigen_config.ml.in index 94569a52d..9114c9a38 100644 --- a/src/baselib/ocsigen_config.ml.in +++ b/src/baselib/ocsigen_config.ml.in @@ -83,18 +83,18 @@ let set_mimefile s = mimefile := s let () = Lwt_log.add_rule "*" Lwt_log.Warning (* without --verbose *) let set_verbose () = verbose := true; - Lwt_log.add_rule "*" Lwt_log.Notice + Lwt_log.add_rule "ocsigen:*" Lwt_log.Notice let set_silent () = silent := true let set_daemon () = set_silent (); daemon := true let set_veryverbose () = verbose := true; veryverbose := true; - Lwt_log.add_rule "*" Lwt_log.Info + Lwt_log.add_rule "ocsigen:*" Lwt_log.Info let set_debug () = verbose := true; veryverbose := true; debug := true; - Lwt_log.add_rule "*" Lwt_log.Debug + Lwt_log.add_rule "ocsigen:*" Lwt_log.Debug let set_minthreads i = minthreads := i let set_maxthreads i = maxthreads := i diff --git a/src/baselib/ocsigen_messages.ml b/src/baselib/ocsigen_messages.ml index 37b10169c..f2e3a3899 100644 --- a/src/baselib/ocsigen_messages.ml +++ b/src/baselib/ocsigen_messages.ml @@ -81,14 +81,7 @@ let open_files ?(user = Ocsigen_config.get_user ()) ?(group = Ocsigen_config.get | _ -> Lwt_log.null); Lwt_log.dispatch (fun sect lev -> - let show = - match lev with - | Lwt_log.Error | Lwt_log.Fatal -> - not (Ocsigen_config.get_silent ()) - | _ -> - Ocsigen_config.get_verbose () - in - if show then stderr else Lwt_log.null)]; + if Ocsigen_config.get_silent () then Lwt_log.null else stderr)]; let gid = match group with | None -> Unix.getgid () @@ -103,9 +96,16 @@ let open_files ?(user = Ocsigen_config.get_user ()) ?(group = Ocsigen_config.get (Unix.getpwnam user).Unix.pw_uid with Not_found as e -> ignore (Lwt_log.error "Error: Wrong user"); raise e) in - Lwt_unix.chown (full_path access_file) uid gid >>= fun () -> - Lwt_unix.chown (full_path warning_file) uid gid >>= fun () -> - Lwt_unix.chown (full_path error_file) uid gid + Lwt.catch + (fun () -> + Lwt_unix.chown (full_path access_file) uid gid >>= fun () -> + Lwt_unix.chown (full_path warning_file) uid gid >>= fun () -> + Lwt_unix.chown (full_path error_file) uid gid) + (fun e -> match e with + | Unix.Unix_error (Unix.EPERM, _, _) -> + (* to allow for symlinks to /dev/null *) + Lwt.return_unit + | _ -> Lwt.fail e) (****) diff --git a/src/extensions/ocsipersist-dbm/ocsipersist.ml b/src/extensions/ocsipersist-dbm/ocsipersist.ml index 12225a73f..28394d54f 100644 --- a/src/extensions/ocsipersist-dbm/ocsipersist.ml +++ b/src/extensions/ocsipersist-dbm/ocsipersist.ml @@ -25,7 +25,7 @@ open Ocsidbmtypes open Lwt -let section = Lwt_log.Section.make "ocsipersist:dbm" +let section = Lwt_log.Section.make "ocsigen:ocsipersist:dbm" (** Data are divided into stores. Create one store for your project, where you will save all your data. *) diff --git a/src/extensions/ocsipersist-pgsql/ocsipersist.ml b/src/extensions/ocsipersist-pgsql/ocsipersist.ml index 2bab268c6..f09afb820 100644 --- a/src/extensions/ocsipersist-pgsql/ocsipersist.ml +++ b/src/extensions/ocsipersist-pgsql/ocsipersist.ml @@ -1,6 +1,6 @@ (** PostgreSQL (>= 9.5) backend for Ocsipersist. *) -let section = Lwt_log.Section.make "ocsipersist:pgsql" +let section = Lwt_log.Section.make "ocsigen:ocsipersist:pgsql" module Lwt_thread = struct include Lwt diff --git a/src/extensions/ocsipersist-sqlite/ocsipersist.ml b/src/extensions/ocsipersist-sqlite/ocsipersist.ml index 42485f067..3b2443d48 100644 --- a/src/extensions/ocsipersist-sqlite/ocsipersist.ml +++ b/src/extensions/ocsipersist-sqlite/ocsipersist.ml @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -let section = Lwt_log.Section.make "ocsipersist:sqlite" +let section = Lwt_log.Section.make "ocsigen:ocsipersist:sqlite" (** Module Ocsipersist: persistent data *)