[systemd-devel] pid file /var/run/dhcpd.pid currenty exists

Reindl Harald h.reindl at thelounge.net
Wed Jun 1 12:17:54 UTC 2016



Am 01.06.2016 um 14:07 schrieb XYZDragon:
> When trying to restart isc-dhcp-server, I was wondering why it didn't
> start. After executing the suggested `journalctl -xe` I could see that
> something was wrong:
>
> May 27 13:32:15 my-pc isc-dhcp-server[26032]: Starting ISC DHCPv4
> server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid
> currenty exists) ... failed!
>
> The message was helpful. I checked the file and noticed that it seemed
> contain a process id. After checking with `ps -p` it seemed that that
> process wasn't running anymore. In my opinion isc-dhcp-server should do
> this check itself without user interaction, deleting the file if it
> exists, but contains a process id of a dead process. After deleting the
> file everything worked.
>
> Also note the word doubling 'dhcpdhcpd' and the missing 'l' in
> 'currenty' in the debug message. Those could be fixed

not a systemd problem, a proper systemd-unit would even advise dhcpd to 
not create any pid-file at all
_______________________________

[root at srv-rhsoft:~]$ cat /etc/systemd/system/dhcpd.service
[Unit]
Description=DHCPD LAN
After=network-wlan-bridge.service

[Service]
Type=simple
ExecStart=/usr/sbin/dhcpd -4 -f -cf /etc/dhcp/dhcpd.conf -user dhcpd 
-group dhcpd --no-pid
Restart=always
RestartSec=1
PrivateTmp=yes
PrivateDevices=yes
CapabilityBoundingSet=CAP_CHOWN CAP_DAC_OVERRIDE CAP_IPC_LOCK CAP_KILL 
CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SETGID CAP_SETUID 
CAP_SYS_CHROOT
ReadOnlyDirectories=/etc
ReadOnlyDirectories=/usr
ReadOnlyDirectories=/var/lib
ReadWriteDirectories=/var/lib/dhcpd
InaccessibleDirectories=/root
InaccessibleDirectories=/media
InaccessibleDirectories=/boot
InaccessibleDirectories=/home

[Install]
WantedBy=multi-user.targe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160601/97057409/attachment.sig>


More information about the systemd-devel mailing list