Jira (PUP-5402) systemd: Puppet agent starts before network-online.target is reached

0 views
Skip to first unread message

Marcel Gätje (JIRA)

unread,
Oct 21, 2015, 5:08:03 AM10/21/15
to puppe...@googlegroups.com
Marcel Gätje created an issue
 
Puppet / Bug PUP-5402
systemd: Puppet agent starts before network-online.target is reached
Issue Type: Bug Bug
Affects Versions: PUP 3.7.2
Assignee: Kylo Ginsberg
Components: Client
Created: 2015/10/21 2:07 AM
Environment:

Puppet 3.7.2 on Ubuntu 15.04 with NetworkManager and DHCP Enviroment

Priority: Normal Normal
Reporter: Marcel Gätje

On Ubuntu 15.04 the puppet agent starts with multi-user.target.
Due to this if using NetworkManager with DHCP, the agent tries to apply configuration before network connection is up.

Changing the puppet.service file and moving the symlink from /etc/systemd/system/multi-user.target.wants/puppet.service to /etc/systemd/system/network-online.target.wants/puppet.service is fixing the problem.

Content of edited puppet.service file:

[Unit]
Description=Puppet agent
Wants=network-online.target
After=network-online.target
 
[Service]
Type=forking
PIDFile=/run/puppet/agent.pid
ExecStart=/usr/bin/puppet agent
 
[Install]
WantedBy=network-online.target

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.11#64026-sha1:78f6ec4)
Atlassian logo

Marcel Gätje (JIRA)

unread,
Oct 21, 2015, 5:10:03 AM10/21/15
to puppe...@googlegroups.com
Marcel Gätje updated an issue
Change By: Marcel Gätje
On Ubuntu 15.04 the puppet agent starts with multi-user.target.
Due to this if using NetworkManager with DHCP, the agent tries to apply configuration before network connection is up  resulting in printing several errors to the logs .


Changing the puppet.service file and moving the symlink from /etc/systemd/system/multi-user.target.wants/puppet.service to /etc/systemd/system/network-online.target.wants/puppet.service is fixing the problem.

Content of edited puppet.service file:

{code:java}

[Unit]
Description=Puppet agent
Wants=network-online.target
After=network-online.target

[Service]
Type=forking
PIDFile=/run/puppet/agent.pid
ExecStart=/usr/bin/puppet agent

[Install]
WantedBy=network-online.target
{code}

Ben Hagen (JIRA)

unread,
Aug 2, 2016, 7:38:04 PM8/2/16
to puppe...@googlegroups.com
Ben Hagen commented on Bug PUP-5402
 
Re: systemd: Puppet agent starts before network-online.target is reached

There is no need to move it to /etc/systemd/system/network-online.target.wants or to make it WantedBy=network-online.target. A working puppet.service file would look like this:

[Unit]
Description=Puppet agent
Wants=network-online.target
After=network-online.target
 
[Service]
Type=forking
EnvironmentFile=-/etc/default/puppet
PIDFile=/run/puppet/agent.pid
ExecStart=/usr/bin/puppet agent $DAEMON_OPTS
 
[Install]
WantedBy=multi-user.target

This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Kylo Ginsberg (JIRA)

unread,
Aug 2, 2016, 7:46:04 PM8/2/16
to puppe...@googlegroups.com
Kylo Ginsberg assigned an issue to Unassigned
 
Change By: Kylo Ginsberg
Assignee: Kylo Ginsberg

Kylo Ginsberg (JIRA)

unread,
Aug 2, 2016, 7:47:02 PM8/2/16
to puppe...@googlegroups.com
Kylo Ginsberg commented on Bug PUP-5402
 
Re: systemd: Puppet agent starts before network-online.target is reached

Is this an issue with current puppet-agent packages?

Ben Hagen (JIRA)

unread,
Aug 2, 2016, 8:12:03 PM8/2/16
to puppe...@googlegroups.com
Ben Hagen commented on Bug PUP-5402

I must confess to only have tested this with puppet 3.8.5 which is included in ubuntu 16.04. I will open a new bugreport on launchpad so this gets fixed in the LTS release and let you know if the issue still exists in the latest puppet-agent as soon as I can. Sorry for the confusion.

Kylo Ginsberg (JIRA)

unread,
Aug 2, 2016, 8:18:03 PM8/2/16
to puppe...@googlegroups.com
Kylo Ginsberg commented on Bug PUP-5402

No worries Ben Hagen. Thanks for stepping in to sort it out. I agree that it sounds like a bug at launchpad makes sense, but it would also be nice to understand if there ends up being a similar issue with puppet-agent builds. Thanks!!

Ben Hagen (JIRA)

unread,
Aug 3, 2016, 7:49:06 AM8/3/16
to puppe...@googlegroups.com
Ben Hagen commented on Bug PUP-5402

Ok I can now confirm that this is still an issue with puppent-agent 1.5.3-1xenial which includes puppet 4.5.3. Using

Wants=network-online.target
After=network-online.target

also fixes it there.

Rene Rinco (JIRA)

unread,
Nov 4, 2016, 12:10:02 PM11/4/16
to puppe...@googlegroups.com
Rene Rinco updated an issue
 
Change By: Rene Rinco
Affects Version/s: PUP 4.8.0
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Rene Rinco (JIRA)

unread,
Nov 4, 2016, 12:14:02 PM11/4/16
to puppe...@googlegroups.com
Rene Rinco commented on Bug PUP-5402
 
Re: systemd: Puppet agent starts before network-online.target is reached

The same here in RHEL7 with 4.8.0:

[root@xl-ifr28 system]# rpm -qf /usr/lib/systemd/system/puppet.service
puppet-agent-1.8.0-1.el7.x86_64
[root@xl-ifr28 system]# cat /usr/lib/systemd/system/puppet.service
#

  1. Local settings can be configured without being overwritten by package upgrades, for example
  2. if you want to increase puppet open-files-limit to 10000,
  3. you need to increase systemd's LimitNOFILE setting, so create a file named
  4. "/etc/systemd/system/puppet.service.d/limits.conf" containing:
  5. [Service]
  6. LimitNOFILE=10000
  7. You can confirm it worked by running systemctl daemon-reload
  8. then running systemctl show puppet | grep LimitNOFILE
    #
    [Unit]
    Description=Puppet agent
    Wants=basic.target
    After=basic.target network.target

[Service]
EnvironmentFile=-/etc/sysconfig/puppetagent
EnvironmentFile=-/etc/sysconfig/puppet
EnvironmentFile=-/etc/default/puppet
ExecStart=/opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process

[Install]
WantedBy=multi-user.target
[root@xl-ifr28 system]#

Russell Mull (JIRA)

unread,
May 15, 2017, 4:24:03 PM5/15/17
to puppe...@googlegroups.com

Russell Mull (JIRA)

unread,
May 15, 2017, 4:24:03 PM5/15/17
to puppe...@googlegroups.com

Christian Lecherbauer (JIRA)

unread,
Dec 6, 2017, 11:26:02 AM12/6/17
to puppe...@googlegroups.com
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Geoff Nichols (JIRA)

unread,
Apr 16, 2018, 9:58:02 PM4/16/18
to puppe...@googlegroups.com
Geoff Nichols updated an issue
 
Change By: Geoff Nichols
Labels: packaging ubuntu
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Branan Riley (JIRA)

unread,
May 10, 2018, 7:18:03 PM5/10/18
to puppe...@googlegroups.com
Branan Riley updated an issue
Change By: Branan Riley
Labels: daemon packaging ubuntu systemd triaged

Bruno Léon

unread,
Feb 14, 2020, 3:45:04 AM2/14/20
to puppe...@googlegroups.com
Bruno Léon commented on Bug PUP-5402
 
Re: systemd: Puppet agent starts before network-online.target is reached

Valid on Ubuntu 18.04

Puppet 6.12

Failed to open TCP connection to XXXXXX:8140 (getaddrinfo: Temporary failure in name resolution)

Vladimir Safronov (Jira)

unread,
Oct 29, 2020, 9:35:03 AM10/29/20
to puppe...@googlegroups.com

Confirmed on CentOS 8.2.2004 with puppet 6.19.1

cat /etc/system-release
CentOS Linux release 8.2.2004 (Core)

puppet --version
6.19.1

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

James Paton-Smith (Jira)

unread,
Feb 17, 2022, 6:39:01 AM2/17/22
to puppe...@googlegroups.com

Looks like the same issue on Ubuntu 20.04.3 with Puppet 6.26.0

# /lib/systemd/system/puppet.service
#
# Local settings can be configured without being overwritten by package upgrades, for example
# if you want to increase puppet open-files-limit to 10000,
# you need to increase systemd's LimitNOFILE setting, so create a file named
# "/etc/systemd/system/puppet.service.d/limits.conf" containing:
# [Service]
# LimitNOFILE=10000
# You can confirm it worked by running systemctl daemon-reload
# then running systemctl show puppet | grep LimitNOFILE
#
[Unit]
Description=Puppet agent
Wants=basic.target
After=basic.target network.target[Service]
EnvironmentFile=-/etc/sysconfig/puppetagent
EnvironmentFile=-/etc/sysconfig/puppet
EnvironmentFile=-/etc/default/puppet
ExecStart=/opt/puppetlabs/puppet/bin/puppet agent $PUPPET_EXTRA_OPTS --no-daemonize
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process[Install]
WantedBy=multi-user.target
 

 

I'm seeing devices fail on their first check-in with the puppet server (after reboot or power on) because Puppet agent runs before NetworkManager brings the network up. I'm also seeing the same for devices which are regularly going in and out of suspend (laptops), which I assume is for the same reason.

 

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 6, 2022, 9:23:01 PM4/6/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Apr 6, 2022, 9:23:01 PM4/6/22
to puppe...@googlegroups.com

Lisa Ross (Jira)

unread,
Apr 7, 2022, 11:20:01 AM4/7/22
to puppe...@googlegroups.com
Lisa Ross updated an issue
Change By: Lisa Ross
Fix Version/s: PUP 7.17.0
Fix Version/s: PUP 6.28.0

Lisa Ross (Jira)

unread,
Apr 7, 2022, 11:21:01 AM4/7/22
to puppe...@googlegroups.com

Nirupama Mantha (Jira)

unread,
Apr 13, 2022, 11:45:03 AM4/13/22
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
Apr 19, 2022, 4:15:02 PM4/19/22
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
Apr 22, 2022, 6:18:03 PM4/22/22
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
Apr 22, 2022, 7:24:01 PM4/22/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Sprint: Phoenix 2022- 05 04 - 11 27

Aria Li (Jira)

unread,
Apr 22, 2022, 7:36:02 PM4/22/22
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
Apr 25, 2022, 1:41:03 PM4/25/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes Summary: Now, Puppet Agent will wait for network-online.target and will not attempt to contact Puppet Server before having network connectivity. Prior, Puppet Agent on Ubuntu 15.04 used to start with a multi-user.target and if using NetworkManager with DHCP, the agent will try to apply configuration before network connection is up resulting in printing several errors to the logs.

Parker Leach (Jira)

unread,
May 23, 2022, 1:29:03 PM5/23/22
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: daemon docs_reviewed packaging platform-os systemd

Josh Cooper (Jira)

unread,
May 23, 2022, 2:43:01 PM5/23/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Community Contributors: jps-help
Reply all
Reply to author
Forward
0 new messages