That's because you're looking at the session bus and not the system bus.
Sorry u'r right...
dbus 992 0.0 0.0 17300 1164 ? Ss Jan08 0:06 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
Hi, i think it's dbus related. Systemd starts dnsmasq with dbus, the rc script doesn't.
I have this problem too, so several service depends to dbus appear to not starting or in failed state.
Polkit results 'dead' and systemd-logind trying to start and fail after a minute and so on.
If you restart dbus, all problems go away and every of this service starts without problem.
The problem imho is dbus.
Ok, i find the way. My problem was openldap that starts too late and 'a lot of time' after dbus, so it (dbus) can't connect to ldap server. Some service (dnsmasq and other) return in failed state because can't connect/authenticate with ldap service. The solution for me is to use nslcd, with nss-pam-ldapd package from AUR. This pkg replace nss_ldap and pam_ldap from official repo.
]]>EDIT: Do you guys have the dbus up and running, like this
% ps auxww | gr -m 1 dbus dbus 319 0.0 0.0 17408 1544 ? Ss Dec19 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
Mine is a little different:
$ ps auxww | grep -m 1 dbus
my_user_name 578 0.0 0.0 17444 1068 ? Ss Jan02 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
I can also confirm that dnsmasq and other custom services are working only with: Type=forking.
I am afraid you didn't understand my previous post. I was talking about the stock dnsmasq.service which has been working on my router for about 1 day now:
% cat /etc/systemd/system/dnsmasq.service
[Unit]
Description=A lightweight DHCP and caching DNS server
After=network.target
Documentation=man:dnsmasq(8)
[Service]
Type=dbus
BusName=uk.org.thekelleys.dnsmasq
ExecStartPre=/usr/bin/dnsmasq --test
ExecStart=/usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file --stop-dns-rebind
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
Alias=dbus-uk.org.thekelleys.dnsmasq
and
% systemctl status dnsmasq.service
dnsmasq.service - A lightweight DHCP and caching DNS server
Loaded: loaded (/etc/systemd/system/dnsmasq.service; enabled)
Active: active (running) since Wed, 2012-12-19 15:51:15 EST; 19h ago
Docs: man:dnsmasq(8)
Process: 398 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 409 (dnsmasq)
CGroup: name=systemd:/system/dnsmasq.service
└─409 /usr/bin/dnsmasq -k --enable-dbus --user=dnsmasq --pid-file --stop-dns-rebind
EDIT: Do you guys have the dbus up and running, like this
% ps auxww | gr -m 1 dbus
dbus 319 0.0 0.0 17408 1544 ? Ss Dec19 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
The only difference between rc.d and service file is that in the former dnsmasq starts backgrounded while in the latter it runs in the foreground (-k). So, what happens if you run manually the service file?
# dnsmasq --test
# echo $?
# dnsmasq -k --enable-dbus --user=dnsmasq --pid-file
Also if you suspect dbus (although I don't see how it can cause problems), try disabling it and running service as Type=forking
/etc/systemd/system/dnsmasq-service
[Unit]
Description=A lightweight DHCP and caching DNS server
After=network.target
Documentation=man:dnsmasq(8)
[Service]
Type=forking
PIDFile=/run/dnsmasq.pid
ExecStart=/usr/bin/dnsmasq --user=dnsmasq --pid-file=/run/dnsmasq.pid
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
This will emulate the rc.d script and should work but I'd still try to investigate the problem with the stock dnsmasq.service.
]]>I'm working on the organization crew of a LAN party we are holding up in Las Palmas, and we are testing dnsmasq service to provice DHCP and DNS cache within the LAN. Everything works OK after I boot up the server: shorewall provides routing and dnsmasq gives IP's and resolves DNS queries... but after some minutes, dnsmasq shuts down:
[root@ion6router multi-user.target.wants]# systemctl status dnsmasq.service
dnsmasq.service - A lightweight DHCP and caching DNS server
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled)
Active: failed (Result: timeout) since dom, 2012-12-09 16:01:21 WET; 9s ago
Docs: man:dnsmasq(8)
Process: 748 ExecStartPre=/usr/bin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 751
CGroup: name=systemd:/system/dnsmasq.service
dic 09 15:59:51 ion6router dnsmasq[751]: started, version 2.64 cachesize 150
dic 09 15:59:51 ion6router dnsmasq[751]: compile time options: IPv6 GNU-getopt DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
dic 09 15:59:51 ion6router dnsmasq[751]: DBus support enabled: connected to system bus
dic 09 15:59:51 ion6router dnsmasq-dhcp[751]: DHCP, IP range 172.16.0.50 -- 172.16.3.254, lease time 12h
dic 09 15:59:51 ion6router dnsmasq[751]: reading /etc/resolv.conf
dic 09 15:59:51 ion6router dnsmasq[751]: using nameserver 194.224.52.6#53
dic 09 15:59:51 ion6router dnsmasq[751]: using nameserver 194.224.52.4#53
dic 09 15:59:51 ion6router dnsmasq[751]: read /etc/hosts - 3 addresses
dic 09 16:01:21 ion6router systemd[1]: Failed to start A lightweight DHCP and caching DNS server.
dic 09 16:01:21 ion6router systemd[1]: Unit dnsmasq.service entered failed state
If I try to start dnsmasq, it fails after 3 o 4 minutes (In those minutes, the service actually works)
[root@ion6router multi-user.target.wants]# systemctl start dnsmasq.service
Job for dnsmasq.service failed. See 'systemctl status dnsmasq.service' and 'journalctl -xn' for details.
Any idea on what could be happening?
Thanks in advance.
]]>