Comments (8)
Getting back to this. Using the $::path
fact in exec
resources is a standard practice, I'm not sure I want to "fix" this in the systemd module.
If this is problematic to you, you could override the fact
path with a file in /etc/puppetlabs/facter/facts.d
or in a wrapper when you launch Puppet, using the FACTER_path
environment variable.
from puppet-systemd.
Would you suggest using an explicit path? That makes sense to me.
from puppet-systemd.
Our local patch is:
diff --git a/code/manifests/systemctl/daemon_reload.pp b/code/manifests/systemctl/daemon_reload.pp
index f42efdc..1d2d05c 100644
--- a/code/manifests/systemctl/daemon_reload.pp
+++ b/code/manifests/systemctl/daemon_reload.pp
@@ -3,8 +3,7 @@
# @api public
class systemd::systemctl::daemon_reload {
exec { 'systemctl-daemon-reload':
- command => 'systemctl daemon-reload',
+ command => '/usr/bin/systemctl daemon-reload',
refreshonly => true,
- path => $::path,
}
}
It of course ignores other platforms where the path could be different :)
from puppet-systemd.
I'm pretty sure that current Gentoo stable is /bin/systemctl
but they're going to switch and it's not in metadata.json. You could also use path => ['/bin', '/usr/bin']
and that'd work on all platforms I think.
from puppet-systemd.
@nbarrientos which puppet version do you use? Can you show our puppet.conf? I under stand the issue, but I'm not able to reproduce it with mit different puppet 5.x systems.
from puppet-systemd.
Hi,
Thanks for replying :)
To "trigger" the issue the value of $PATH
on the interactive shell that invokes Puppet interactively has to be different from the value that the Puppet daemon has.
# puppet --version
4.9.4
# cat /proc/$(pgrep puppet)/environ
LANG=en_US.UTF-8PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
# facter --version && facter path
3.6.2 (commit c352bf42c7cbce7349fc70753beee4535340537c)
/usr/sue/sbin:/usr/sue/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin
In our case it's different because we do this:
# cat /etc/profile.d/puppet-agent.sh
# Add /opt/puppetlabs/bin to the path for sh compatible users
if ! echo $PATH | grep -q /opt/puppetlabs/bin ; then
export PATH=$PATH:/opt/puppetlabs/bin
fi
But I'd say that's totally normal to have a different path for login shells ;)
Here it is our puppet.conf
, although I believe there's nothing relevant to this issue in it :)
# cat /etc/puppetlabs/puppet/puppet.conf
# Installed by cernpuppet
[main]
ssldir = /var/lib/puppet/ssl
localcacert = /etc/pki/tls/certs/foo-bundle.pem
[agent]
server = master.example.com
ca_server = ca.example.com
masterport = 8144
ca_port = 8140
report = true
environment = qa
splay = true
splaylimit = 900
runinterval = 1300
listen = false
certificate_revocation = false
postrun_command = /usr/bin/run-parts /etc/puppetlabs/puppet/post-scripts.d
usecacheonfailure = false
Thanks!
from puppet-systemd.
Getting back to this. Using the $::path fact in exec resources is a standard practice,
Is it? It is camptocamp modules :-) Not sure I've seen it else where.
from puppet-systemd.
Maybe I'm too used to our own standard? 😕
from puppet-systemd.
Related Issues (20)
- manage_unit service_entry Environment can't have multiple values HOT 3
- Running the example code for `systemd::manage_unit` from REFERENCE.md causes an error:
- Add possibility to setup limits for user sessions HOT 6
- IODeviceWeight, IOReadIOPSMax, .. do not work in systemd::manage_unit or systemd::dropin_file HOT 1
- Missing parameters under Service section HOT 2
- Provide possibility to disable service restart upon unit file change
- Add hiera-friendly option to manage dropins HOT 2
- Add `NetworkNamespacePath` to unit service HOT 4
- Allow specifying multiple Environment variable HOT 2
- Usage of `systemd::escape` in `systemd::timer_wrapper` creates weird names HOT 7
- [4.1.0] ignore active+enable when ensure is set to absent for systemd::timer HOT 1
- Issue with hiera since v 7.0.0 HOT 2
- systemd::user_service broken for puppet running in background HOT 3
- Deprecation of systemd::service_limits unexpectedly causes service restarts in some scenarios HOT 7
- Add support for systemd link files HOT 2
- Allow systemd unit specifiers in path values HOT 2
- Setting default_target fails due to deprecated shell_escape function HOT 2
- Inconsistent values for `notify_service` in replacement for `systemd::service_limits` HOT 1
- udev rules not reloaded after change
- Unit file path inconsistency HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-systemd.