Skip to content

Commit 36c9cc1

Browse files
author
root
committed
use file instead of /dev/stdout
1 parent 00475c4 commit 36c9cc1

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ install: all
1111
install cbsd-mq-router /usr/local/sbin
1212
ifeq ($(UNAME_S),Linux)
1313
install systemd/cbsd-mq-router.service /lib/systemd/system/cbsd-mq-router.service
14+
@test -d /var/log/cbsdmq || mkdir -m 0755 /var/log/cbsdmq
15+
@chown nobody:nogroup /var/log/cbsdmq
16+
@test -r /etc/cbsd-mq-router.json || sed 's:/dev/stdout:/var/log/cbsdmq/stdout.log:g' etc/cbsd-mq-router.json > /etc/cbsd-mq-router.json
1417
else
1518
install rc.d/cbsd-mq-router /usr/local/etc/rc.d/cbsd-mq-router
1619
endif

log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func log_init(logfile string) {
3232
f, err := os.OpenFile(logfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)
3333

3434
if err != nil {
35-
fmt.Printf("config load error: %s", err)
35+
fmt.Printf("log_init: config load error: %s", err)
3636
os.Exit(1)
3737
}
3838

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func main() {
3434
config, err := LoadConfiguration(*configFile)
3535

3636
if err != nil {
37-
fmt.Println("config load error")
37+
fmt.Println("main: config load error")
3838
os.Exit(1)
3939
}
4040

0 commit comments

Comments
 (0)