Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8682183b
Commit
8682183b
authored
Nov 14, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LogInit: default to journal if MPD was started as systemd service
parent
94c31d0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
NEWS
NEWS
+1
-0
LogInit.cxx
src/LogInit.cxx
+14
-0
No files found.
NEWS
View file @
8682183b
...
...
@@ -2,6 +2,7 @@ ver 0.21.3 (not yet released)
* output
- alsa: fix crash bug
- alsa: fix stuttering at start of playback
* log: default to journal if MPD was started as systemd service
ver 0.21.2 (2018/11/12)
* protocol
...
...
src/LogInit.cxx
View file @
8682183b
...
...
@@ -30,6 +30,10 @@
#include "util/RuntimeError.hxx"
#include "system/Error.hxx"
#ifdef ENABLE_SYSTEMD_DAEMON
#include <systemd/sd-daemon.h>
#endif
#include <assert.h>
#include <string.h>
#include <fcntl.h>
...
...
@@ -139,6 +143,16 @@ log_init(const ConfigData &config, bool verbose, bool use_stdout)
if
(
param
==
nullptr
)
{
/* no configuration: default to syslog (if
available) */
#ifdef ENABLE_SYSTEMD_DAEMON
if
(
sd_booted
()
&&
getenv
(
"NOTIFY_SOCKET"
)
!=
nullptr
)
{
/* if MPD was started as a systemd
service, default to journal (which
is connected to fd=2) */
out_fd
=
STDOUT_FILENO
;
return
;
}
#endif
#ifndef HAVE_SYSLOG
throw
std
::
runtime_error
(
"config parameter 'log_file' not found"
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment