Re: [Kea-users] Auto start

2016-07-20 Thread Tobias -
Hi Todd!

I've tried to do the same thing. I tried to adapt Kea to systemd but I was 
unable to get satisfying results using keactrl so I opted to skip that step and 
run the services directly and I wrote a service file for each one. I also 
changed the logger configuration to output all logging information to /dev/log 
and let journald handle it, allowing me to use the features of journald. The 
Kea services expect logger_lockfile to exist even if the logger has been 
configured to just print to /dev/log, so I added two ExecStartPre commands.

Kea shouldn't handle the logging, it should let syslogd or journald handle it, 
they both use the same interface and is compatible with both BSD and Linux. If 
you have journald (I believe that all distrubutions with systemd do) then I 
recommend that you take advantage of it by pointing the output in the logger 
configuration in kea.conf to /dev/log. For anyone who doesn't use journald then 
I highly recommend that you also configure the logging daemon to put the output 
of kea into separate log files which is a common practice.

Here are the results (also sent as attachments):

- kea-dhcp4.service -
[Unit]
Description=ISC Kea DHCPv4 server
Documentation=man:kea-dhcp4(8)
Wants=network.target

[Service]
user=kea
ProtectSystem=full
ProtectHome=true
ExecStartPre=/usr/bin/mkdir -p /var/run/kea/
ExecStartPre=/usr/bin/touch /var/run/kea/logger_lockfile
ExecStart=/usr/bin/kea-dhcp4 -c /etc/kea/kea.conf
ExecReload=/usr/bin/kill --signal SIGHUP ${MAINPID}
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
- EOF -
- kea-dhcp6.service -
[Unit]
Description=ISC Kea DHCPv4 server
Documentation=man:kea-dhcp6(8)
Wants=network.target

[Service]
user=kea
ProtectSystem=full
ProtectHome=true
ExecStartPre=/usr/bin/mkdir -p /var/run/kea/
ExecStartPre=/usr/bin/touch /var/run/kea/logger_lockfile
ExecStart=/usr/bin/kea-dhcp6 -c /etc/kea/kea.conf
ExecReload=/usr/bin/kill --signal SIGHUP ${MAINPID}
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
- EOF -
- kea-dhcp-ddns.service -
[Unit]
Description=ISC Kea DHCP-DDNS server
Documentation=man:kea-dhcp-ddns(8)
Wants=network.target

[Service]
user=kea
ProtectSystem=full
ProtectHome=true
ExecStartPre=/usr/bin/mkdir -p /var/run/kea/
ExecStartPre=/usr/bin/touch /var/run/kea/logger_lockfile
ExecStart=/usr/bin/kea-dhcp-ddns -c /etc/kea/kea.conf
ExecReload=/usr/bin/kill --signal SIGHUP ${MAINPID}
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
- EOF -

Tobias


From: todsi...@cisco.com
To: klausfi...@gmail.com
Date: Thu, 21 Jul 2016 01:26:55 +
Subject: Re: [Kea-users] Auto start
CC: kea-users@lists.isc.org







Klaus,



Thanks for the info.  I did try the following:



Added a new user:  adduser kea -s /sbin/nologin 
Created the file:   /etc/systemd/system/kea.service




[Unit]
Description=kea Service
After=network.target

[Service]
Type=simple
User=kea
ExecStart=/usr/local/sbin/keactrl start
Restart=on-abort


[Install]
WantedBy=multi-user.target





Then I type this command: systemctl start kea
Then I check it with this command:  systemctl status kea




[root@localhost todsimmo]# systemctl status kea
‚óè kea.service - kea Service
   Loaded: error (Reason: Invalid argument)
   Active: failed (Result: exit-code) since Wed 2016-07-20 14:01:45 CDT; 5min 
ago
 Main PID: 4111 (code=exited, status=1/FAILURE)







I’ve also tried calling the kea-dhcp4 command, but it doesn’t work either.



Any help is appreciated,









Todd













From: Klaus Steden <klausfi...@gmail.com>

Date: Wednesday, July 20, 2016 at 9:13 PM

To: Todd Simmons <todsi...@cisco.com>

Cc: "kea-users@lists.isc.org" <kea-users@lists.isc.org>

Subject: Re: [Kea-users] Auto start









CentOS 7 uses systemd. I'm by no means an expert on it, but you may be able to 
shoehorn systemd into thinking that it's a managed service (there's apparently 
legacy support for SVR4-style init scripts) using systemctl. Again, being still 
new to systemd
myself, I can't really offer much useful advice beyond that, but that's where 
I'd start looking.



hth,
Klaus



On Wed, Jul 20, 2016 at 5:25 PM, Todd Simmons (todsimmo)
<todsi...@cisco.com> wrote:



Kea Users,




I’m on CentOS 7 running the Kea 1.0.0 server without issues.  My only problem 
is that if my system is shutdown or rebooted I have to manually run “keactrl 
start” to get the server running again.  What options do I have to have the 
DHCP server startup automatically? 
I tried chkconfig, but keactrl or the kea-dhcp4/6 are not listed as services.



Thanks for the help,









Todd 







___

Kea-users mailing list

Kea-users@lists.isc.org

https://lists.isc.org/mailman/listinfo/kea-users














___
Kea-users mailing list
Kea-users@lists.isc.org
https://lists.

Re: [Kea-users] Auto start

2016-07-20 Thread Todd Simmons (todsimmo)
Klaus,

Thanks for the info.  I did try the following:

Added a new user:  adduser kea -s /sbin/nologin
Created the file:   /etc/systemd/system/kea.service


[Unit]
Description=kea Service
After=network.target

[Service]
Type=simple
User=kea
ExecStart=/usr/local/sbin/keactrl start
Restart=on-abort


[Install]
WantedBy=multi-user.target

Then I type this command: systemctl start kea
Then I check it with this command:  systemctl status kea

[root@localhost todsimmo]# systemctl status kea
‚óè kea.service - kea Service
   Loaded: error (Reason: Invalid argument)
   Active: failed (Result: exit-code) since Wed 2016-07-20 14:01:45 CDT; 5min 
ago
 Main PID: 4111 (code=exited, status=1/FAILURE)


I’ve also tried calling the kea-dhcp4 command, but it doesn’t work either.

Any help is appreciated,



Todd



From: Klaus Steden <klausfi...@gmail.com<mailto:klausfi...@gmail.com>>
Date: Wednesday, July 20, 2016 at 9:13 PM
To: Todd Simmons <todsi...@cisco.com<mailto:todsi...@cisco.com>>
Cc: "kea-users@lists.isc.org<mailto:kea-users@lists.isc.org>" 
<kea-users@lists.isc.org<mailto:kea-users@lists.isc.org>>
Subject: Re: [Kea-users] Auto start


CentOS 7 uses systemd. I'm by no means an expert on it, but you may be able to 
shoehorn systemd into thinking that it's a managed service (there's apparently 
legacy support for SVR4-style init scripts) using systemctl. Again, being still 
new to systemd myself, I can't really offer much useful advice beyond that, but 
that's where I'd start looking.

hth,
Klaus

On Wed, Jul 20, 2016 at 5:25 PM, Todd Simmons (todsimmo) 
<todsi...@cisco.com<mailto:todsi...@cisco.com>> wrote:
Kea Users,

I’m on CentOS 7 running the Kea 1.0.0 server without issues.  My only problem 
is that if my system is shutdown or rebooted I have to manually run “keactrl 
start” to get the server running again.  What options do I have to have the 
DHCP server startup automatically?  I tried chkconfig, but keactrl or the 
kea-dhcp4/6 are not listed as services.

Thanks for the help,



Todd

___
Kea-users mailing list
Kea-users@lists.isc.org<mailto:Kea-users@lists.isc.org>
https://lists.isc.org/mailman/listinfo/kea-users


___
Kea-users mailing list
Kea-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users


Re: [Kea-users] Auto start

2016-07-20 Thread Klaus Steden
CentOS 7 uses systemd. I'm by no means an expert on it, but you may be able
to shoehorn systemd into thinking that it's a managed service (there's
apparently legacy support for SVR4-style init scripts) using systemctl.
Again, being still new to systemd myself, I can't really offer much useful
advice beyond that, but that's where I'd start looking.

hth,
Klaus

On Wed, Jul 20, 2016 at 5:25 PM, Todd Simmons (todsimmo)  wrote:

> Kea Users,
>
> I’m on CentOS 7 running the Kea 1.0.0 server without issues.  My only
> problem is that if my system is shutdown or rebooted I have to manually run
> “keactrl start” to get the server running again.  What options do I have to
> have the DHCP server startup automatically?  I tried chkconfig, but keactrl
> or the kea-dhcp4/6 are not listed as services.
>
> Thanks for the help,
>
>
>
> Todd
>
>
> ___
> Kea-users mailing list
> Kea-users@lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
>
>
___
Kea-users mailing list
Kea-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users