|
NAMEos_sup - Interface to OS System MessagesDESCRIPTIONos_sup is a process providing a message passing service from the operating system to the error logger in the Erlang runtime system. It is part of the OS_Mon application, see os_mon(6). Available for Solaris and Windows.Messages received from the operating system results in an user defined callback function being called. This function can do whatever filtering and formatting is necessary and then deploy any type of logging suitable for the user's application. SOLARIS OPERATIONThe Solaris (SunOS 5.x) messages are retrieved from the syslog daemon, syslogd.Enabling the service includes actions which require root privileges, such as change of ownership and file privileges of an executable binary file, and creating a modified copy of the configuration file for syslogd. When os_sup is terminated, the service must be disabled, meaning the original configuration must be restored. Enabling/disabling can be done either outside or inside os_sup. See Configuration below. Warning:
This process cannot run in multiple instances on the same hardware. OS_Mon must
be configured to start os_sup on one node only if two or more Erlang
nodes execute on the same machine.
The format of received events is not defined. WINDOWS OPERATIONThe Windows messages are retrieved from the eventlog file.The nteventlog module is used to implement os_sup. See nteventlog(3). Note that the start functions of nteventlog does not need to be used, as in this case the process is started automatically as part of the OS_Mon supervision tree. OS messages are formatted as a tuple {Time, Category, Facility, Severity, Message}:
CONFIGURATION
Default is {os_sup, error_report, [Tag]} which will send the event to the error logger using error_logger:error_report(Tag, Msg). Tag is the value of os_sup_errortag, see below.
EXPORTSenable() -> ok | {error, Res}enable(Dir, Conf) -> ok | {error, Error} Types: Dir = Conf = Res = string()
Enables the os_sup service. Needed on Solaris only. If the configuration parameter os_sup_enable is false, this function is called automatically by os_sup, using the values of os_sup_own and os_sup_syslogconf as arguments. If os_sup_enable is true, this function must be called before OS_Mon/os_sup is started. Dir defines the directory which contains the backup copy and the Erlang specific configuration files for syslogd, and a named pipe to receive the messages from syslogd. Defaults to "/etc". Conf defines the full name of the configuration file for syslogd. Default is "/etc/syslog.conf". Results in a OS call to: <PRIVDIR>/bin/mod_syslog otp Dir Conf where <PRIVDIR> is the priv directory of OS_Mon, code:priv_dir(os_mon). Returns ok if this yields the expected result "0", and {error, Res} if it yields anything else. Note:
This function requires root privileges to succeed.
disable() -> ok | {error, Res}
Types: Dir = Conf = Res = string()
Disables the os_sup service. Needed on Solaris only. If the configuration parameter os_sup_enable is false, this function is called automatically by os_sup, using the same arguments as when enable/2 was called. If os_sup_enable is true, this function must be called after OS_Mon/os_sup is stopped. Dir defines the directory which contains the backup copy and the Erlang specific configuration files for syslogd, and a named pipe to receive the messages from syslogd. Defaults to "/etc". Conf defines the full name of the configuration file for syslogd. Default is "/etc/syslog.conf". Results in a OS call to: <PRIVDIR>/bin/mod_syslog nootp Dir Conf where <PRIVDIR> is the priv directory of OS_Mon, code:priv_dir(os_mon). Returns ok if this yields the expected result "0", and {error, Res} if it yields anything else. Note:
This function requires root privileges to succeed.
SEE ALSOerror_logger(3), os_mon(3)syslogd(1M), syslog.conf(4) in the Solaris documentation.
Visit the GSP FreeBSD Man Page Interface. |