More linux confusion

Posted by James Palmer on 13-Sep-2016 15:03

Sorry for another post about Linux stuff. I'm running an Amazon instance. I have to use sudo to run commands - makes sense. But I'm struggling to get the Progress utilities working. 

[ec2-user@ip-172-31-7-139 db]$ sudo $DLC/bin/_proutil sports2000 -C dbanalys

proutil: _dbutil was not found.

I've worked out that using sudo visudo I can edit the path and environment variables so the path is correct and I've added DLC. Yet it still doesn't work. 

If I run _dbuitl direct it works ok, but there's stuff I still can't work out. like how to pipe the dbanalys to file.

All Replies

Posted by Rob Fitzpatrick on 13-Sep-2016 15:06

In your environment setup, also add the $DLC/bin directory to the path and export it.

export PATH=$DLC/bin:$PATH

Posted by Dyego Sousa on 13-Sep-2016 15:10

James,
you may export your DLC variable before to run the proutil


Dyego Fernandes de Sousa

Posted by LarryDusch on 13-Sep-2016 15:10

Once you have your PATH situation resolved, you just redirect the output to a file:

sudo $DLC/bin/_proutil sports2000 -C dbanalys > /tmp/sportsdbanal.txt

Posted by James Palmer on 13-Sep-2016 15:23

Ouch I had a typo in the path. Stupid me!

Posted by James Palmer on 13-Sep-2016 15:25

And the /tmp was the key to the redirect. Wouldn't write to the folder I wanted to. Getting my head around these permissions is fun!

Posted by James Palmer on 13-Sep-2016 15:25

Thanks for the quick help.

Posted by cverbiest on 14-Sep-2016 06:38

sudo doesn't preserve your environment, see env_keep directive in sudoers file

you may want to add DLC to env_keep if you have access to the sudoers config

Posted by bronco on 14-Sep-2016 07:38

BTW, I would be more comfortable when things are setup in such a way that I don't need root rights to do my db maintenance.

Posted by James Palmer on 14-Sep-2016 09:50

I'd agree, but sometimes you have to live with what you're given. :)

This thread is closed