Puppet Error 400 on SERVER: A duplicate resource was found while collecting exported resources, with the type and title Host

Even after clearing the certs from puppetmaster and client, if you are getting below error on your puppet client

Error 400 on SERVER: A duplicate resource was found while collecting exported resources, with the type and title Host

then its because you have messed up with certs badly.

Here is what you need to do.

Check the certs name from ls -al ${PUPPET_HOME}/ssl/ -R

once of the cert above has multiple hostname in it. Find all the hostname that comes as part of above command and delete all of them from puppet master.

once done clean the ssl folder from client

rm -rf ${PUPPET_HOME}/ssl/

and run the puppet agent.

Linux run script/service after few mins of reboot

You can use systemd timers to execute script a minute after boot.

First, create service file (/etc/systemd/system/myscript.service):

[Unit]
Description=MyScript

[Service]
Type=simple
ExecStart=/usr/local/bin/myscript

Then create timer (/etc/systemd/system/myscript.timer):

[Unit]
Description=Runs myscript every hour

[Timer]
# Time to wait after booting before activation
OnBootSec=1min
Unit=myscript.service

[Install]
WantedBy=multi-user.target
Now enable and run it:

# systemctl enable myscript.timer
# systemctl start myscript.timer

.so: cannot open shared object file: Permission denied

When I start the application in debug mode (sh -x) it works fine after taking few seconds while loading the libraries but without debug mode it failes with .so : cannot open shared object file: Permission denied even though it has proper read permission as well as proper read permission to all parent folders.

Then I figured out that its due to selinux in enforcing state.

Change : /etc/selinux/config from SELINUX=enforcing ## or permissive to SELINUX=disabled