A restart of openHAB causes file permissions to change in ~openhab/.ssh

Thanks for your patience, @rlkoshak,

Of course I tried both paths in the rule. Ths sym link as well as the “real” folder /etc/openhab/configurations/script.
Same result (with ls as well as chmod)

Here’s a thought. Perhaps the openhab user’s environment doesn’t have anything in its path. Try passing the full path to ls, or chmod, or any other command you are using from within the executeCommandLine. For example:

var results = executeCommandLine("/bin/ls -l /etc/openhab/configurations/scripts/*.sh", 5000)
logInfo("Permissions", results)

GOT IT !!!
A played around a little more and found out that
/bin/chmod u+x /etc/openhab/configurations/scripts/*
does NOT work, but
/bin/chmod u+x -R /etc/openhab/configurations/scripts/
does work!!! - Even without the full path to chmod

So it seems that it’s related to "*"
I don’t have any idea, why it’s working in your case as you suggested above!?
Does this ring a bell?

1 Like

I’ve no idea. It might be the case that the * is being interpreted as something instead of being passed to the command line.

tell me which file to add this code?

var String results = executeCommandLine("chmod a+x /etc/openhab/configurations/scripts/*", 5000) logInfo("Network", "Resetting permissions on script:\n" + results) results = executeCommandLine("chmod go-r ~openhab/.ssh/*", 5000) logInfo("Network", "Resetting permissions on .ssh:\n" + results) results = executeCommandLine("/etc/openhab/configurations/scripts/resetGarageMqttReporter.sh", 5000) logInfo("Network", "Resetting garage mwttReporter. Results:\n" + results)

Those are rules (in your rules files) that can be called before you need to execute your ssh action or I guess you could execute them when OpenHAB starts (i.e. When System started).

This code needs to go into a .rules file in the rules directory of your configuration folder in a rule with a system started trigger as @federic0 suggests. If you need information about rules please see the rules wiki page.

Added rule on Start system trigger

Error
2016-02-16 00:47:06.710 [INFO ] [g.openhab.model.script.Network] - Resetting permissions on script: chmod: невозможно получить доступ к «/etc/openhab/configurations/scripts/*»: Нет такого файла или каталога 2016-02-16 00:47:07.357 [INFO ] [g.openhab.model.script.Network] - Resetting permissions on .ssh: chmod: невозможно получить доступ к «~openhab/.ssh/*»: Нет такого файла или каталога