Kea autostart process issue
name: Reboot process id issue
Describe the bug After an improper shutdown not all services are started. We use "keactrl start" on system startup to start the dhcp4 and control agent service. When a process id is reused for another process this prevents the old kea process to start.
To Reproduce Steps to reproduce the behavior:
- Run Kea (dhcpv4 and ca, configuration not relevant)
- Improperly shutdown the machine
- After booting the server again it still has a file called kea-ctrl-agent.kea-ctrl-agent.pid (but can happen for other services too) containing a process id.
- ps -p 403 shows the process id previously used by the control agent is now in use for the SSH deamon: 403 ? 00:00:00 sshd
- The keactrl script sees the process id in the file is already an active process (the wrong one) and does not start the control agent: INFO/keactrl: kea-ctrl-agent appears to be running, see: PID 403, PID file: /usr/local/var/kea/kea-ctrl-agent.kea-ctrl-agent.pid.
Expected behavior I can think of several workarounds (deleting .pid file when starting the machine, or modifying the keactrl script to check the name of the process) but I would like to know if others also have this issue and what we might have done wrong.
Kea version: which release? if it's compiled from git, which revision. Use kea-dhcp4 -V to find out. kea-dhcp4 -V 1.4.0-P1 git 68ebf634 linked with: log4cplus 1.1.2 OpenSSL 1.0.2g 1 Mar 2016 database: Memfile backend 2.0
OS: [e.g. Ubuntu 16.04 x64] lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.5 LTS Release: 16.04 Codename: xenial
Which features were compiled in (in particular which backends)
If/which hooks where loaded in: Default 1.4 hooks.
Adiitional information: we run kea inside Ubuntu LXD containers.
Some initial questions
- Are you sure your feature is not already implemented in the latest Kea version? Yes
- Are you sure what you would like to do is not possible using some other mechanisms? No
- Have you discussed your idea on kea-users or kea-dev mailing lists? No
Participating in development Are you willing to participate in the feature development? ISC team always tries to make a feature as generic as possible, so it can be used in wide variety of situations. That means the proposed solution may be a bit different that you initially thought. Are you willing to take part in the design discussions? Are you willing to test an unreleased engineering code? Yes
Contacting you How can ISC reach you to discuss this matter further? If you do not specify any means such as e-mail, jabber id or a telephone, we may send you a message on github with questions when we have them. E-mail: firstname.lastname@example.org