Skip to main content

Cheers!

I'm working on a FME routine containing quite a few SystemCaller transformers containing psql calls to remote DB servers. This worked fine on Win and then suddenly I decided to try out FME for Linux ;0

Thing is that I'm left clueless of how to use the SystemCaller to pass my command to a Linux shell.

Trying the following from SystemCaller:

"sudo -u postgres /opt/fmeserver/resources/temp/truncate_temp_db.sh"

And the .sh is just your plain simple psql command to a remote server:

"psql -h <host> -p <port> -U <user> -d <database> -c "<SOME SQL HERE>;"

Permissions to execute .sh is set to all users hoping that "fmeserver" user have the neccesary privileges, but I still haven't had any luck with this approach. I'm not that Linux savvy I have to admit so if someone can give me a nudge in the right direction - I'd really appreciate that. I can revert to using SQL executor for this but I really want to know if SystemCaller is any good on FME for Linux.

Kind regards,

Saamot

I don't see why it wouldn't work. Do you get an error message anywhere that might help to debug this. When you say you have no luck, what happens? I would also turn on log debug under the FME Options to give a little more information in the log about what action is being carried out.

 


I don't see why it wouldn't work. Do you get an error message anywhere that might help to debug this. When you say you have no luck, what happens? I would also turn on log debug under the FME Options to give a little more information in the log about what action is being carried out.

 

Can you run those exact commands from the command line when logged in as the user under whom the FME Server runs? I can imagine lots of ways that doing "sudo" without the right permissions/paths could go off the rails.

SystemCaller is fully supported on Linux.  Assuming that the postgres user requires a password for sudo, you'll need something like

echo <password> | sudo -S -u postgres /opt/fmeserver/resources/temp/truncate_temp_db.sh

in order to avoid hanging FME while a password is waited for.  If that is not the problem, please post a description (or log snippet) of how your workspace is failing.


SystemCaller is fully supported on Linux.  Assuming that the postgres user requires a password for sudo, you'll need something like

echo <password> | sudo -S -u postgres /opt/fmeserver/resources/temp/truncate_temp_db.sh

in order to avoid hanging FME while a password is waited for.  If that is not the problem, please post a description (or log snippet) of how your workspace is failing.

Exactly the solution I was looking for. Thanks!  :)

 

 


Reply