LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 07-21-2017, 10:50 AM   #1
Haines Brown
LQ Newbie
 
Registered: Nov 2010
Location: Hartford, CT
Distribution: Devuan Jessie
Posts: 27

Rep: Reputation: 0
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?

Haines Brown
 
Old 07-21-2017, 11:11 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
add link from /opt/appDir/command -> /usr/local/bin

that is accessible to all users then
no change permissions
Code:
userx@devuan-do:~$ cd /opt
userx@devuan-do:/opt$ sudo nano hello
userx@devuan-do:/opt$ sudo chmod +x hello
userx@devuan-do:/opt$ sudo ln -s /opt/hello /usr/local/bin
userx@devuan-do:/opt$ hello
link from /opt to /usr/local/bin
userx@devuan-do:/opt$

Last edited by BW-userx; 07-21-2017 at 11:23 AM.
 
Old 07-21-2017, 11:35 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Does /root/opt stick out to anyone ?
 
Old 07-21-2017, 11:52 AM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
good point.... I do not think that is even a standardized dir in Prussia even.

Last edited by BW-userx; 07-21-2017 at 12:06 PM.
 
Old 07-21-2017, 11:56 AM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,585

Rep: Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351
Quote:
Originally Posted by Habitual View Post
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.
 
Old 07-21-2017, 11:59 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,357
Blog Entries: 13

Rep: Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411
Quote:
Originally Posted by Habitual View Post
Does /root/opt stick out to anyone ?
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?
 
Old 07-21-2017, 12:01 PM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 5,587
Blog Entries: 16

Rep: Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316
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.
 
Old 07-21-2017, 07:04 PM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
I agree.
 
Old 07-22-2017, 05:25 AM   #9
Haines Brown
LQ Newbie
 
Registered: Nov 2010
Location: Hartford, CT
Distribution: Devuan Jessie
Posts: 27

Original Poster
Rep: Reputation: 0
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/.

Haines Brown
 
Old 07-22-2017, 06:29 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 5,587
Blog Entries: 16

Rep: Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316Reputation: 3316
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.

Last edited by hazel; 07-22-2017 at 06:31 AM.
 
Old 07-22-2017, 06:31 AM   #11
Haines Brown
LQ Newbie
 
Registered: Nov 2010
Location: Hartford, CT
Distribution: Devuan Jessie
Posts: 27

Original Poster
Rep: Reputation: 0
[Solved]

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.

Haines Brown
 
Old 07-22-2017, 08:16 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Glad it /opt/worked/out!
 
Old 07-22-2017, 08:19 AM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
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.
 
Old 07-22-2017, 08:27 AM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,585

Rep: Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351Reputation: 2351
Quote:
Originally Posted by BW-userx View Post
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.
 
Old 07-22-2017, 08:46 AM   #15
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by 273 View Post
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.

Last edited by BW-userx; 07-22-2017 at 08:48 AM.
 
  


Reply

Tags
path, symlink


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Access program installed by root from source by a regular user NotionCommotion Linux - Newbie 11 11-16-2014 03:03 PM
[SOLVED] Program not accessible in KDE for only one user JZL240I-U Linux - Software 3 04-30-2013 04:57 AM
Is it possible to run program installed in root user by regular users? cent_sangeeta General 4 11-06-2012 10:35 AM
Executing MS windows based program which is installed through Wine as a non-root user akram Linux - Newbie 1 07-31-2009 05:18 AM
making mounted drives accessible to user pablowablo Linux - Newbie 7 07-27-2004 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration