Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log/syslog: New/Dial fail on FreeBSD #8449

Closed
gopherbot opened this issue Jul 30, 2014 · 4 comments
Closed

log/syslog: New/Dial fail on FreeBSD #8449

gopherbot opened this issue Jul 30, 2014 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by erickheit@dyn.com:

% go version
go version go1.3 freebsd/amd64
% uname -v
FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012
root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC

syslog.New() correctly finds the syslog unix-domain socket on linux, but not
on freebsd. On my (somewhat out-of-date) freebsd system, the code below gives
the less-than-helpful message: "Unix syslog delivery error"

It looks like a simple fix is to add "/var/run/log" to the logPaths list in
src/pkg/log/syslog/syslog_unix.go

The workaround, of course, is to call
    syslog.Dial("unixgram", "/var/run/log",...)
instead, but that's not terribly portable.

Here's a trivial test program:

package main
import "log/syslog"
import "fmt"
import "os"

func main() {
    slog, err := syslog.New(syslog.LOG_DAEMON, "stuff")
    if err != nil {
        fmt.Fprintln(os.Stderr, "syslog.New failed: ", err)
    }
    slog.Info("can you see me logging?")
}
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-go1.4.

@ianlancetaylor
Copy link
Contributor

Comment 2:

Labels changed: added os-freebsd.

@gopherbot
Copy link
Author

Comment 3:

CL https://golang.org/cl/145600044 mentions this issue.

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 4:

This issue was closed by revision 5a1906d.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
Fixes golang#8449.

LGTM=iant
R=golang-codereviews, iant
CC=bradfitz, golang-codereviews
https://golang.org/cl/145600044
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
Fixes golang#8449.

LGTM=iant
R=golang-codereviews, iant
CC=bradfitz, golang-codereviews
https://golang.org/cl/145600044
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
Fixes golang#8449.

LGTM=iant
R=golang-codereviews, iant
CC=bradfitz, golang-codereviews
https://golang.org/cl/145600044
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
Fixes golang#8449.

LGTM=iant
R=golang-codereviews, iant
CC=bradfitz, golang-codereviews
https://golang.org/cl/145600044
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants