Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang-history
erlang-history-Do-not-crash-warn-in-group_histo...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File erlang-history-Do-not-crash-warn-in-group_history-during-disk_log-shutdown.patch of Package erlang-history
diff -Ndurp erlang-history/src/5.2/group_history.erl erlang-history-Do-not-crash-warn-in-group_history-during-disk_log-shutdown/src/5.2/group_history.erl --- erlang-history/src/5.2/group_history.erl 2019-09-04 19:48:57.837990480 +0300 +++ erlang-history-Do-not-crash-warn-in-group_history-during-disk_log-shutdown/src/5.2/group_history.erl 2019-09-04 19:48:05.238418483 +0300 @@ -25,7 +25,7 @@ load() -> wait_for_kernel_safe_sup(), case history_status() of enabled -> - case open_log() of + try open_log() of {ok, ?LOG_NAME} -> read_full_log(?LOG_NAME); {repaired, ?LOG_NAME, {recovered, Good}, {badbytes, Bad}} -> @@ -49,6 +49,10 @@ load() -> handle_open_error(Reason), disable_history(), [] + catch + % disk_log shut down abruptly, possibly because + % the node is shutting down. Ignore it. + exit:_ -> [] end; _ -> [] @@ -158,7 +162,7 @@ matches_log(Txt) -> %% Return whether the shell history is enabled or not -spec history_status() -> enabled | disabled. history_status() -> - case is_user() orelse application:get_env(kernel, shell_history) of + case is_user() orelse init_running() orelse application:get_env(kernel, shell_history) of true -> disabled; % don't run for user proc {ok, enabled} -> enabled; undefined -> ?DEFAULT_STATUS; @@ -170,6 +174,14 @@ history_status() -> is_user() -> process_info(self(), registered_name) =:= {registered_name, user}. +%% Return if the system is running (not stopping) +-spec init_running() -> boolean(). +init_running() -> + case init:get_status() of + {stopping, _} -> false; + _ -> true + end. + %% Open a disk_log file while ensuring the required path is there. open_log() -> Opts = log_options(), @@ -361,7 +373,7 @@ show_unexpected_warning({M,F,A}, Term) - show_unexpected_close_warning() -> show('$#erlang-history-unexpected-close', - "The shell log file has mysteriousy closed. Ignoring " + "The shell log file has mysteriously closed. Ignoring " "currently unread history.~n", []). show_size_warning(_Current, _New) ->
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor