mirror of
https://github.com/systemd/systemd.git
synced 2024-12-28 11:21:59 +03:00
core: make sure PrivateDevices= makes /dev/log available
Now that we moved the actual syslog socket to /run/systemd/journal/dev-log we can actually make /dev/log a symlink to it, when PrivateDevices= is used, thus making syslog available to services using PrivateDevices=.
This commit is contained in:
parent
7e9f159ca7
commit
82d252404a
@ -143,7 +143,7 @@ static int mount_dev(BindMount *m) {
|
||||
"/dev/tty\0";
|
||||
|
||||
char temporary_mount[] = "/tmp/namespace-dev-XXXXXX";
|
||||
const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devkdbus = NULL, *devhugepages = NULL, *devmqueue = NULL;
|
||||
const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devkdbus = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL;
|
||||
_cleanup_umask_ mode_t u;
|
||||
int r;
|
||||
|
||||
@ -188,6 +188,9 @@ static int mount_dev(BindMount *m) {
|
||||
mkdir(devhugepages, 0755);
|
||||
mount("/dev/hugepages", devhugepages, NULL, MS_BIND, NULL);
|
||||
|
||||
devlog = strappenda(temporary_mount, "/dev/log");
|
||||
symlink("/run/systemd/journal/dev-log", devlog);
|
||||
|
||||
NULSTR_FOREACH(d, devnodes) {
|
||||
_cleanup_free_ char *dn = NULL;
|
||||
struct stat st;
|
||||
|
@ -383,7 +383,8 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
umask(0022);
|
||||
|
||||
if ((n = sd_listen_fds(true)) < 0) {
|
||||
n = sd_listen_fds(true);
|
||||
if (n < 0) {
|
||||
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user