LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Installed software only runs as root (http://www.linuxquestions.org/questions/linux-software-2/installed-software-only-runs-as-root-918904/)

cov 12-15-2011 11:31 AM

Installed software only runs as root
 
I've just installed DraftSight on a Ubuntu 11.10 install.

I've downloaded the /deb file and run dpkg -i on it which has installed the software in /opt/dassault-systemes/draftsight/bin/DraftSight

Code:

ls -l /opt/dassault-systemes/draftsight/bin/DraftSight
-rwxr-xr-x 1 root root 815 2011-10-01 08:48 /opt/dassault-systemes/draftsight/bin/DraftSight

]Starting the software as a normal user give the following error:
Code:

DraftSight.bin: main.cpp:162: QString WriteProtected(QDir, int): Assertion `0' failed.
Aborted

Running it with sudo also fails.

However if I invoke the superuser by typing sudo su, then the software starts up correctly.

Can anyone suggest what I need to do to allow a normal user to use the software? The problem is that files saved are owned by root.

sgosnell 12-15-2011 12:13 PM

Reinstall it with gdebi or Synaptic, not dpkg. That should set the necessary permissions.

cov 12-19-2011 09:58 AM

Well, installing in gdebi has the same result.

Not sure how to install using synaptic.

cov 01-18-2012 11:34 AM

Damn.

Still having this problem.

Only thing Google throws up is this thread.

eSelix 01-18-2012 12:03 PM

Maybe this software store files in current directory or application directory. Can you for testing give permissions 0777 to this directory and try to launch as normal user? If this will be succesful, then its bad, because you can't change program behavior, eventually change working directory before launching to user HOME or /tmp.

If not, Linux has a nice command:
Code:

strace -e trace=file /opt/dassault-systemes/draftsight/bin/DraftSight
Search where error occurs and read in which directory or paste output here.

business_kid 01-18-2012 12:12 PM

That error may well be because a luser cannot write wherever this thing is writing stuff. If the user can't run the file, it's "Permission Denied"

But no user can write on /opt

cov 01-18-2012 12:39 PM

I've change the ownership of the directory in /opt to dave:dave, but it still fails if I invoke the app under the dave user.

Code:

chown dave:dave -R dassault-systemes
root@SNECCI:/opt# ls -l dassault-systemes/
total 4
drwxr-xr-x 10 dave dave 4096 2012-01-18 18:22 draftsight
root@SNECCI:/opt# ls -l dassault-systemes/draftsight/bin/
total 38384
drwxr-xr-x  2 dave dave    4096 2012-01-18 18:22 codecs
-rwxr-xr-x  1 dave dave      815 2011-10-01 08:48 DraftSight
-rwxr-xr-x  1 dave dave 10312740 2011-10-01 08:48 DraftSight.bin
-rw-r--r--  1 dave dave    25868 2011-10-01 08:48 DsCommandVarsDict.xml
-rw-r--r--  1 dave dave    12712 2011-10-01 08:48 DsLispDict.xml
-rwxr-xr-x  1 dave dave  1062220 2011-10-01 22:18 ExtCommands.tx
-rwxr-xr-x  1 dave dave  360267 2011-10-01 08:48 FxCharMap.tx
-rwxr-xr-x  1 dave dave 18956455 2011-10-01 08:48 FXCommands.tx
-rwxr-xr-x  1 dave dave  413681 2011-10-01 08:48 FXCurves.tx
-rwxr-xr-x  1 dave dave  2307705 2011-10-01 08:48 FXDimCommands.tx
-rwxr-xr-x  1 dave dave  293287 2011-10-01 08:48 FXEvalWatcher.tx
-rwxr-xr-x  1 dave dave  1062863 2011-10-01 08:48 FXGripPoints.tx
-rwxr-xr-x  1 dave dave  2830314 2011-10-01 08:48 FXProperties.tx
-rwxr-xr-x  1 dave dave  336600 2011-10-01 08:48 HelpGuide
drwxr-xr-x  2 dave dave    4096 2012-01-18 18:22 imageformats
-rwxr-xr-x  1 dave dave    23109 2011-10-01 08:48 K2GestureWidget.tx
drwxr-xr-x 15 dave dave    4096 2012-01-18 18:22 messages
-rwxr-xr-x  1 dave dave  225657 2011-10-01 08:48 ModelerGeometry.tx
-rwxr-xr-x  1 dave dave    93745 2011-10-01 08:48 PlotStyleServices.tx
-rwxr-xr-x  1 dave dave    73506 2011-10-01 08:48 RasterProcessor.tx
-rwxr-xr-x  1 dave dave  769365 2011-10-01 08:48 RecomputeDimBlock.tx
-rwxr-xr-x  1 dave dave    90636 2011-10-01 08:48 RxRasterServices.tx
drwxr-xr-x  2 dave dave    4096 2012-01-18 18:22 sqldrivers

Subsequently running strace as you suggest gives this:

Code:

dave@SNECCI:~/Documents/ACAD/Blocks/Models$ strace -e trace=file /opt/dassault-systemes/draftsight/bin/DraftSight
execve("/opt/dassault-systemes/draftsight/bin/DraftSight", ["/opt/dassault-systemes/draftsigh"...], [/* 44 vars */]) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY) = 3
stat64("/home/dave/Documents/ACAD/Blocks/Models", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
open("/opt/dassault-systemes/draftsight/bin/DraftSight", O_RDONLY) = 3
--- SIGCHLD (Child exited) @ 0 (0) ---
--- SIGCHLD (Child exited) @ 0 (0) ---
stat64("/usr/lib32/gconv", 0xbfe0b680)  = -1 ENOENT (No such file or directory)
chdir("/opt/dassault-systemes/draftsight/bin") = 0
stat64("/etc/fedora-release", 0xbfe0b660) = -1 ENOENT (No such file or directory)
DraftSight.bin: main.cpp:162: QString WriteProtected(QDir, int): Assertion `0' failed.
--- SIGCHLD (Child exited) @ 0 (0) ---
Aborted

Lots of "no such file or directory", particularly where it seems to be looking in the /etc directory; not an entirely appropriate location for some of them...

DavidMcCann 01-18-2012 12:46 PM

I see that the Linux version is described as a beta, so it's more likely that the problem is with the program than anything you did in installing. Tell them about it.

cov 01-18-2012 03:52 PM

Yes, I must admit that I am rapidly coming to this conclusion too.

However, it's been a month since this problem surfaced, I would have expected it to be fixed by now if it were a general bug.

The company is probably also hoping to make money by providing support (as they are entitled to do IMO), so there is no forum or free knowledgebase through which to provide them with the information which may help them solve this...

eSelix 01-18-2012 06:34 PM

The difference between "sudo some_app" and "sudo su" is that former does not change the HOME variable. I did some testing and discover that this application does not work (I get segfault) when user has no write permission to file ~/.config/DraftSight/1.2.188/Workspace/Classic Default.xml So, check this. I sugest you to take ownership of all files in your home directory, because if you often using sudo you may also get other applications working improperly:
Code:

sudo chown -Rc dave:dave /home/dave

cov 01-19-2012 01:08 AM

Thanks very much for your efforts on this.

Oddly enough, sudo /opt/dassault-systemes/draftsight/bin/DraftSight doesbn't work.

Code:

dave@SNECCI:~$ sudo /opt/dassault-systemes/draftsight/bin/DraftSight
[sudo] password for dave:
DraftSight.bin: main.cpp:162: QString WriteProtected(QDir, int): Assertion `0' failed.
Aborted

Permissions in my home directory are fine, though:

Code:

dave@SNECCI:~$ ls -l .config/DraftSight/
total 4
drwxrwxr-x 13 dave dave 4096 2011-10-25 09:15 1.2.188
lrwxrwxrwx  1 dave dave  20 2011-11-14 09:20 Documents -> /home/dave/Documents
dave@SNECCI:~$ ls -l .config/DraftSight/1.2.188/
total 48
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:14 Alias
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:14 Fonts
-rw-rw-r--  1 dave dave  360 2011-11-14 09:36 history.txt
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:14 Linestyles
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:21 Print Settings
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:14 Print Styles
drwxrwxr-x  3 dave dave 4096 2011-10-25 09:14 Profiles
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:14 RichLine Styles
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:14 Support
drwxrwxr-x  2 dave dave 4096 2011-10-25 09:14 Template
drwxrwxr-x 15 dave dave 4096 2011-10-25 09:14 UI
drwxrwxr-x  2 dave dave 4096 2011-11-14 09:36 Workspace
dave@SNECCI:~$ ls -l .config/DraftSight/1.2.188/Workspace/
total 4
-rw-rw-r-- 1 dave dave 2213 2011-11-14 09:36 Classic Default.xml



All times are GMT -5. The time now is 03:02 AM.