isc-dhcp-server status failed: Failed with result 'exit code' - ubuntu-server

I setup a simple dhcp-server with isc-dhcp-server, but when I start the service, the status is in failed with the message "failed with result 'exit code' ".
And yes, I did configure the files /etc/dhcp/dhcp.conf and /etc/default/dhcpd.conf
I checked more information with the command journalctl -ex the show the next input. But I dont know what the input said, because I configured the interface and dhcp server.
I dont know what doing to solve this issue. Somebody know what doing in this case.

This gave me the solution:
$ sudo su
$ systemctl restart isc-dhcp-server.service
$ systemctl status isc-dhcp-server.service
It it still fails like here
root#wd-Latitude-E6530:/home/wd# systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - ISC DHCP IPv4 server
Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-06-17 11:29:47 CEST; 56s ago
Docs: man:dhcpd(8)
Process: 2167 ExecStart=/bin/sh -ec CONFIG_FILE=/etc/dhcp/dhcpd.conf; if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf; fi; [ ->
Main PID: 2167 (code=exited, status=1/FAILURE)
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]:
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: If you think you have received this message due to a bug rather
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: than a configuration issue please read the section on submitting
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: bugs on either our web page at www.isc.org or in the README file
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: before submitting a bug. These pages explain the proper
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: process and the information we find helpful for debugging.
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]:
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: exiting.
jun 17 11:29:47 wd-Latitude-E6530 systemd[1]: isc-dhcp-server.service: Main process exited, code=exited, status=1/FAILURE
jun 17 11:29:47 wd-Latitude-E6530 systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Check the process ID; like 2167 and command:
$ journalctl _PID=2167 {your PID should be different}
For me it gave back:
jun 17 11:30:52 wd-Latitude-E6530 sh[2193]: /etc/dhcp/dhcpd.conf line 57: subnet 10.10.10.1 netmask 255.255.255.0: bad subnet number/mask combination.
jun 17 11:30:52 wd-Latitude-E6530 sh[2193]: subnet 10.10.10.1 netmask 255.255.255.0
In /etc/dhcp/dhcpd.conf I needed to change
subnet 10.10.10.1 netmask 255.255.255.0
into
subnet 10.10.10.0 netmask 255.255.255.0
So 10.10.10.1 into 10.10.10.0
$ systemctl restart isc-dhcp-server.service
$ systemctl status isc-dhcp-server.service
And now I get it working:
Active: active (running) since Thu 2021-06-17 11:50:51 CEST; 2s ago
Your issue might be different, but journalctl _PID=#### will give you some feedback and from there you can troubleshoot.
It looks like you're missing a subnet. I am using this
[...]
subnet 10.10.10.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.10.255;
option routers 10.10.10.1;
option domain-name-servers 10.10.10.1;
range 10.10.10.3 10.10.10.250;
if exists user-class and option user-class = "iPXE" {
filename "boot.ipxe";
} else {
filename "undionly.kpxe";
This is part of my iPXE server.

I was following some tech blog for setting up isc-dhcp-server, and I just ended up using the same configuration file (with the same ips, ranges etc).
After 2 days long googling changing machines, and everything, I got nothing, and I figured out that I need to configure the dhcpd.conf file based on my own network interface's (i.e. 'eth0' in my case) ip. And it worked!

Related

Tor not starting cleanly on boot

I'm running Debian 10 with bitcoind configured as a systemd service that accesses the tor service via localhost. Every reboot the bitcoind error log is filled with the following, and tor services seem to be stuck in a non-working state.
2020-11-18T03:38:30Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)
2020-11-18T03:38:30Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)
2020-11-18T03:38:31Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)
2020-11-18T03:38:31Z connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)
Upon startup systemctl status tor returns the following, indicating tor started successfully
tor.service - Anonymizing overlay network for TCP (multi-instance-master)
Loaded: loaded (/lib/systemd/system/tor.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2020-11-17 19:54:04 PST; 4min 19s ago
Process: 413 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 413 (code=exited, status=0/SUCCESS)
Nov 17 19:54:04 cryptoDaemon systemd[1]: Starting Anonymizing overlay network for TCP (multi-instance-master)...
Nov 17 19:54:04 cryptoDaemon systemd[1]: Started Anonymizing overlay network for TCP (multi-instance-master).
However tail -f /var/log/tor/notices.log indicates tor hasn't started. There are no entries after the reboot.
If I restart tor.service with sudo systemctl restart tor the error immediately disappears and bitcoind starts to function over tor correctly. This indicates to me that the tor service itself is not starting properly after reboot.
After restarting the service /var/log/notices.log gets new entries:
Nov 17 20:02:22.000 [notice] Tor 0.3.5.10 opening log file.
Nov 17 20:02:22.875 [notice] We compiled with OpenSSL 1010104f: OpenSSL 1.1.1d 10 Sep 2019 and we are running with OpenSSL 1010107f: OpenSSL 1.1.1g 21 Apr 2020. These two versions should be binary compatible.
Nov 17 20:02:22.877 [notice] Tor 0.3.5.10 running on Linux with Libevent 2.1.8-stable, OpenSSL 1.1.1g, Zlib 1.2.11, Liblzma 5.2.4, and Libzstd 1.3.8.
Nov 17 20:02:22.877 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Nov 17 20:02:22.877 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc".
Nov 17 20:02:22.877 [notice] Read configuration file "/etc/tor/torrc".
Nov 17 20:02:22.881 [notice] You configured a non-loopback address '10.1.10.20:9050' for SocksPort. This allows everybody on your local network to use your machine as a proxy. Make sure this is what you wanted.
Nov 17 20:02:22.881 [notice] Opening Socks listener on 127.0.0.1:9050
Nov 17 20:02:22.881 [notice] Opened Socks listener on 127.0.0.1:9050
Nov 17 20:02:22.881 [notice] Opening Control listener on 127.0.0.1:9051
Nov 17 20:02:22.881 [notice] Opened Control listener on 127.0.0.1:9051
Nov 17 20:02:22.881 [warn] Unable to make /var/lib/tor group-readable: Permission denied
Nov 17 20:02:22.881 [warn] Unable to make /var/lib/tor group-readable: Permission denied
Nov 17 20:02:22.000 [notice] Not disabling debugger attaching for unprivileged users.
Nov 17 20:02:22.000 [notice] Parsing GEOIP IPv4 file /usr/share/tor/geoip.
Nov 17 20:02:23.000 [notice] Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
Nov 17 20:02:23.000 [notice] Bootstrapped 0%: Starting
Nov 17 20:02:23.000 [notice] Starting with guard context "default"
Nov 17 20:02:23.000 [notice] Signaled readiness to systemd
Nov 17 20:02:24.000 [notice] Bootstrapped 10%: Finishing handshake with directory server
Nov 17 20:02:24.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Nov 17 20:02:24.000 [notice] Opening Control listener on /run/tor/control
Nov 17 20:02:24.000 [notice] Opened Control listener on /run/tor/control
Nov 17 20:02:24.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
Nov 17 20:02:25.000 [notice] Bootstrapped 100%: Done
Further investigation reveals that tor is not starting at boot. /var/log/tor/debug.log is empty after reboot. I can even run systemctl start tor and it starts. systemctl start tor won't mess with a service that is already started, so for some reason systemd isn't starting tor, despite it being enabled. Just for fun I disabled with systemctl disable tor and re-enabled, but to no avail.
Any ideas why tor doesn't start?
I also use this server as a Tor SOCKS proxy on the LAN using SOCKSPORT IP.OF.SERVER:9050 in torrc. disabling this and the associated SOCKSPolicy accept IP.OF.SERVER/24 fixed the issue. If anybody has any insight as to why tor behaves this way and doesn't log why, it'd be appreciated.
I fixed it by overriding the systemd configuration for the tor service since i Need the tor Proxy to listen to an actual network interface.
/etc/systemd/system/tor#default.service.d/override.conf
[Unit]
After=network.target nss-lookup.target network-online.target
Wants=network-online.target
Easy way to create the file is systemctl edit tor#default.service

/etc/network/interfaces:4: option with empty value

I am trying to install OpenIMSCore and following the steps from this link and I am getting the below error when trying to restart the network,
root#ubuntu16:~/.test/OpenIMSCore# /etc/init.d/networking restart
[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.
failed!
root#ubuntu16:~/.test/OpenIMSCore# systemctl status networking.service
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
Active: failed (Result: exit-code) since Sat 2018-08-04 01:17:51 IST; 19s ago
Docs: man:interfaces(5)
Process: 27064 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=1/FAILURE)
Process: 27167 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Process: 27164 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=ex
Main PID: 27167 (code=exited, status=1/FAILURE)
Aug 04 01:17:51 ubuntu16 systemd[1]: Starting Raise network interfaces...
Aug 04 01:17:51 ubuntu16 sh[27164]: /etc/network/interfaces:4: option with empty value
Aug 04 01:17:51 ubuntu16 sh[27164]: ifquery: couldn't read interfaces file "/etc/network/interfaces"
Aug 04 01:17:51 ubuntu16 ifup[27167]: /etc/network/interfaces:4: option with empty value
Aug 04 01:17:51 ubuntu16 ifup[27167]: /sbin/ifup: couldn't read interfaces file "/etc/network/interfaces"
Aug 04 01:17:51 ubuntu16 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Aug 04 01:17:51 ubuntu16 systemd[1]: Failed to start Raise network interfaces.
Aug 04 01:17:51 ubuntu16 systemd[1]: networking.service: Unit entered failed state.
Aug 04 01:17:51 ubuntu16 systemd[1]: networking.service: Failed with result 'exit-code'.
After debugging I found that the issue was with the /etc/network/interfaces file, when added the below params (from DEVICE, HWADDR to PEERDNS) and start the network I am getting the above error.
Did anyone face the same issues while modifying the interfaces file (my /etc/hosts file & /etc/resolv.conf file are similar to the once provided in the above link).
Any reference on this would also be of great help !
Thanks in advance.
You'll probably kick yourself, but you've got the same typo on two lines. It should be iface eth0 inet dhcp not dchp.
ifup and ifdown will break if they can't parse the file.

cgconfig service won't start up

I have already referenced this post: Centos cgconfig fails to start
I have a centos 7 machine. I've tried commenting out and leaving in memory in the following /etc/cgconfig.conf file:
mount {
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
cpuacct = /cgroup/cpuacct;
memory = /cgroup/memory;
devices = /cgroup/devices;
freezer = /cgroup/freezer;
net_cls = /cgroup/net_cls;
blkio = /cgroup/blkio;
}
I've also manually created that directory structure. When I run service cgconfig start, systemctl status cgconfig.service gives me this:
cgconfig.service - Control Group configuration service
Loaded: loaded (/usr/lib/systemd/system/cgconfig.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-03-14 20:27:40 EDT; 18s ago
Process: 6713 ExecStart=/usr/sbin/cgconfigparser -l /etc/cgconfig.conf -L /etc/cgconfig.d -s 1664 (code=exited, status=101)
Main PID: 6713 (code=exited, status=101)
Mar 14 20:27:40 localhost.localdomain systemd[1]: Starting Control Group configuration service...
Mar 14 20:27:40 localhost.localdomain cgconfigparser[6713]: /usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Mar 14 20:27:40 localhost.localdomain cgconfigparser[6713]: Error: cannot mount cpu to /cgroup/cpu: Device or resource busy
Mar 14 20:27:40 localhost.localdomain systemd[1]: cgconfig.service: main process exited, code=exited, status=101/n/a
Mar 14 20:27:40 localhost.localdomain systemd[1]: Failed to start Control Group configuration service.
Mar 14 20:27:40 localhost.localdomain systemd[1]: Unit cgconfig.service entered failed state.
Mar 14 20:27:40 localhost.localdomain systemd[1]: cgconfig.service failed.
I've also tried to look at /proc/mounts to perhaps unmount cpu.
Any help to get the cgconfig service to start would be helpful.
$ lssubsys -a
cpu,cpuacct
If is a cosubsystem like 'cpu,cpuacct', must mount in the same hierachy (for cg).
Running on Ubuntu I could resolve the same issue by installing the libcgmanager which provides the daemon cgmanager.

Error in starting postgresql service in linux through command line

I was starting the postgresql service by
systemctl start postgresql.service
It was raising an error as below
Job for postgresql.service failed. See "systemctl status postgresql.service" and "journalctl -xn" for details.
Please help how to start the service through command line in linux?
Output for journalctl -xn
osboxes:/home/osboxes # journalctl -xn
-- Logs begin at Wed 2015-04-08 10:08:38 BST, end at Tue 2016-03-22 14:15:07 GMT. --
Mar 22 14:09:03 osboxes wickedd[824]: eno16777760: Notified neighbours about IP address 192.168
Mar 22 14:09:03 osboxes wickedd[824]: route ipv4 0.0.0.0/0 via 192.168.182.2 dev eno16777760 ty
Mar 22 14:09:04 osboxes wickedd[824]: Skipping hostname update, none available
Mar 22 14:15:01 osboxes cron[9120]: pam_unix(crond:session): session opened for user root by (u
Mar 22 14:15:01 osboxes systemd[9121]: pam_unix(systemd-user:session): session opened for user
Mar 22 14:15:01 osboxes CRON[9120]: pam_unix(crond:session): session closed for user root
Mar 22 14:15:01 osboxes systemd[9122]: pam_unix(systemd-user:session): session closed for user
Mar 22 14:15:07 osboxes postgresql[9160]: Initializing PostgreSQL 9.3.11 at location ~postgres/
Mar 22 14:15:07 osboxes postgresql[9160]: ..failed
Mar 22 14:15:07 osboxes postgresql[9160]: You can find a log of the initialisation in ~postgres

Unable to activate sendmail due to error

I installed sendmail on my Fedora 21 Server installation but when I start it and check it's status I get the following:
[root#localhost mail]# systemctl status sendmail
● sendmail.service - Sendmail Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/sendmail.service; enabled)
Active: failed (Result: resources) since Thu 2015-06-04 11:23:31 CEST; 2min 39s ago
Process: 31776 ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG (code=exited, status=0/SUCCESS)
Process: 31766 ExecStartPre=/etc/mail/make aliases (code=exited, status=0/SUCCESS)
Process: 31763 ExecStartPre=/etc/mail/make (code=exited, status=0/SUCCESS)
Jun 04 11:23:31 localhost.localdomain sendmail[31776]: -bd is not supported by sSMTP
Jun 04 11:23:31 localhost.localdomain systemd[1]: Failed to start Sendmail Mail Transport Agent.
Jun 04 11:23:31 localhost.localdomain systemd[1]: Unit sendmail.service entered failed state.
Jun 04 11:23:31 localhost.localdomain systemd[1]: sendmail.service failed.
What is the problem here? I thought the -bd is not supported by sSMTP was a hint. But I can't find anything on this either.
sSMTP is a send-only sendmail emulator. It does not support -bd option when run as a daemon (see "man ssmtp"). Current sendmail in F21 is an alias to ssmtp. You need to remove ssmtp entirely from F21 (yum erase sSMTP).

Resources