openwrt / openwrt/packages

syslog-ng: late start on boot prevents dnsmasq from starting

Open
#20,971 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @BKPepe
Environment: armv7l, InHand Networks VG710, OpenWrt 22.03.0-rc4

Description:

/etc/rc.d/S19dnsmasq tries to mount /dev/log in jail but fails because /dev/log doesn't exist yet because /etc/rc.d/S50syslog-ng hasn't been run yet. The end result is that dnsmasq is not running:

~# ps aux | grep '[d]nsmasq'
~#

The issue can be easily reproduced even without syslog-ng installed:

~# mv /dev/log /dev/log.bak
~# /sbin/ujail -t 5 -n test-ujail -l -- /bin/echo hi; echo $?
jail: stat(/dev/log) failed: No such file or directory
jail: mount_all() failed
jail: failed to build jail fs
jail: jail (9738) exited with exit: 1
1

I wonder if other users of OpenWRT also have this problem? I haven't seen any bug reports but it looks quite serious so I'm wondering. Would it be a bad idea to start syslog-ng earlier, S12 as with logd should be ok, in my test even S18 (so one less that S19 for dnsmasq) was enough?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with /etc/rc.d/S19dnsmasq and /etc/rc.d/S50syslog-ng, then reproduce the failure using the provided /sbin/ujail command after moving /dev/log. Check the boot ordering and verify that dnsmasq starts successfully when /dev/log is available before its jail is built.

Written by the indexing model from the issue text.

Assessment

Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.