Making program installed in /root/opt accessible to user
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Making program installed in /root/opt accessible to user
A program with an automatic installer script created a /root/opt directory and placed its
program files in a directory there. Among the files is an executable that root can run
successfully. My aim is to have an executable in the path of the user. The installer tried
to place an icon in my desktop environment, but I don't run such an environment, but merely
fluxbox window manager.
I tried a symlink in /usr/local/bin to the program executable and gave ownership to user.
However, that still runs up against permission problem. What is the most straightforward way
to make an executable owned by root and located outside user's path accessible to a user?
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by Habitual
Does /root/opt stick out to anyone ?
yes, first ting I thought was that either the installer expects to be run in / so, then, will install in opt or that the location could be changed in the installer but was chosen in error. Either way, a removal and reinstall is needed as any workarounds may render the system unsafe to use.
Absolutely and it why I opened this thread at having seen the title.
I'm wondering how this came to be, such as how it was installed, or what it is being run, if a script or other. Either case, an executable should not be there really. Perhaps it can be re-installed with a process which places it in the correct location.
Worst case, how about moving or copying the executable to /usr/local/bin and then referencing it this way?
To run anything, you need read access to every directory on its path. /root is the personal directory of the root user and no one outside the root group has access to it. I'm pretty sure /root/opt is an error for /opt.
For those who thought /root/opt was a mistake on my part, it was in fact the case.
Let me be more specific.
The program is QCAD. It comes as a ".run" installer script. I placed this script into
a directory I created, /usr/local/share/QCAD/ and made it executable. I ran the installer
as root because I was not instructed otherwise and sometimes an installer needs to have
access to directories not accessible to the user. Some program installations specify
they should be installed by user, but not in this case.
This is what was returned:
...................................................................................
QCAD Setup...
Making dir /root/opt/qcadcam-3.17.3-trial-linux-x86_64...
mkdir: created directory ‘/root/opt’
mkdir: created directory ‘/root/opt/qcadcam-3.17.3-trial-linux-x86_64’
Copying files...
Invoking postinstall.sh...
Installing mimetypes...
Installing mimetype icons...
Installing desktop menu entries...
xdg-desktop-menu: No writable system menu directory found.
Installing desktop icon...
Creating uninstall script...
Setting executable flag...
QCAD Setup finished.
This /root/opt came as a surprise. No menu found because I don't run a desktop.
Unfortunately, the executable (qcad) was not added to fluxbox's menu either. No
icon, of course. The problem was this left me to search for a qcad executable
or symlink in user's path, and that effort failed. The only executable found
was the one in root/opt/qcadcam-3.17.3-trial-linux-x86_64/. Off hand, the
program seems to run fine if done by root.
An on-line search suggests qcad should have been installed by user, and it
creates a directory ~/opt for user. So an uninstall and reinstall as user will
probably solve the problem. I try to keep programs out of /opt and prefer
locating them in /usr/local/share/.
Or you can simply move the files by hand from /root/opt into /opt (or /usr/local).
This definitely was a mistake but not yours! It was a serious error by the people who designed the installer. They should have known that /root/opt isn't a valid directory for executables.
Things ran much better when installed as user. The program installed itself
in user's ~/opt. Because I don't run a desktop, I had to create an entry
in fluxbox/menu for the executable by hand.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by BW-userx
it was his mistake. he installed it improperly. it just did what it is suppose to do. install itself in the user logged in home dir under username/opt
... think about it.
Since when has that been a conventional place to install a program? Heck, in some security models the user's home folder shouldn't even allow execution of programs.
Since when has that been a conventional place to install a program? Heck, in some security models the user's home folder shouldn't even allow execution of programs.
I'm not saying it is or isn't a security risk, only saying that he just improperly installed the software - so it was his fault for what it did and not the ones that wrote it.
He just did what even me (I) and perhaps a few others might have done, just stick it in what seems to be a logical place then started the install, only to find out it is not installing like one thought it would thus the, what the hell is this ? question pops into the head and a state of confusion as a result of it.
but the laying and accepting of blame in the right place is a good thing. when one is actually to be blamed for it. it helps builds a proper ego structure. ones mental state is more important then the software being installed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.