Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postinst.pl --configdir working but not aware of agent behaviour when looking for config files #136

Open
kejones999 opened this issue Apr 10, 2018 · 0 comments
Assignees

Comments

@kejones999
Copy link

kejones999 commented Apr 10, 2018

General informations

Operating system : Debian Stretch
Perl version :5.24.1

OCS Inventory informations

Unix agent version : 2.4.1

Problem's description

I've been upgrading our systems to use 2.4.1 manually (because Debian stable still only has an old package) and am utterly enjoying the postinst.pl script but ran into a small conceptual issue. If you specify the --configdir parameter it works fine and creates the right files in the right place. Unfortunately though, it's not aware of the agent's behaviour when it's looking for its config files and doesn't remove configs from locations the agent will look for first. Effectively alternate paths/configs never get seen if they're lower down the pecking order of paths the agent looks in.

Given the coding in the script, might I suggest it makes more use of the ordering of the search path array (ie my @default_configdirs = "/etc/ocsinventory", "/usr/local/etc/ocsinventory", "/etc/ocsinventory-agent")?

Theoretically, when you match the --configdir to it, it should be fairly easy to work backwards from that point in the array and "move" higher priority config files down to the new location if needed. By taking advantage of clobbering you'd hopefully end up with a nicely migrated single config file where you expect it to be and simultaneously remove the configs the agent keeps finding (I hope!)

Sorry! That might need more explaining! - So I just edited this :-)

Regards,

Keith

Inventory log file ( optional )

Use github cloud or trusted upload website

@fbomj fbomj self-assigned this Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants