LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-09-2014, 11:46 AM   #1
Geist
Member
 
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 442

Rep: Reputation: 196Reputation: 196
Program installed for single user runs correctly from shell but not from script


I'm on Slackware 14.1 (current) and using zsh as my shell but I think this might be a general question.

Problematic program is Synfig Studio which comes as a generalized binary package containing its own bin, etc, share and lib directories.

I have installed it into ~/Apps/Synfig which contains Synfigs local file structure.

Running it from the shell/terminal with /home/me/Apps/Synfig/bin/synfigstudio works as expected.
It picks up the library path without updating environment variables and the program finds all its components, plugins, icons and the like.

Running it from a script, however, required me to set up the LD_LIBRARY_PATH variable to get it running in the first place but it can't find any of its icons, giving me error messages like:

Code:
Gtk-WARNING **: Error loading icon: Failed to open file '/opt/synfig/share/pixmaps/synfigstudio/set_fill_color.png': No such file or directory
Repeated for all the assets.
Thing is, these files really do not exist there, yet if the program is launched from the shell then it picks its own local structure out correctly, not looking into /opt/.

Why is that and how can I set that up for the script?

Solution:
a cd to the Synfig local root folder before running the binary did the trick.

In the case of my script:
Code:
#!/bin/bash
restrictwacom.sh
DEVICE="Wacom Intuos3 9x12"
STYLUS="$DEVICE stylus"
ERASER="$DEVICE eraser"
PAD="$DEVICE pad"

sh wacomdefaults.sh
export PATH=/home/me/Apps/Synfig/bin:${PATH}
export LD_LIBRARY_PATH=/home/me/Apps/Synfig/lib:${LD_LIBRARY_PATH}
cd /home/me/Apps/Synfig/
synfigstudio

Last edited by Geist; 03-09-2014 at 01:46 PM. Reason: solved
 
Old 03-09-2014, 12:09 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I do not really know that synfig, but I think there should be an environment variable pointing to that installation, otherwise it won't be able to find itself.
I think it has an environment setup file to run before executing any app.
 
Old 03-09-2014, 12:34 PM   #3
Geist
Member
 
Registered: Jul 2013
Distribution: Slackware 14 / current
Posts: 442

Original Poster
Rep: Reputation: 196Reputation: 196
Quote:
Originally Posted by pan64 View Post
I do not really know that synfig, but I think there should be an environment variable pointing to that installation, otherwise it won't be able to find itself.
I think it has an environment setup file to run before executing any app.
Hm you mean synfig sets that up for itself? Shouldn't that work from wherever then? Shell or script?
Anyway. I've also created an account on the Synfig forum and I'll ask there as well.

I'm still interested in a general solution, if there is indeed one that isn't specific to me running this particular program like this but the whole process in general (as in differences between launching programs from an interactive running shell/terminal vs script (with shebang)).

P.S.: I tried both sourcing and executing the script, both run the program but it still can't find the icons and co in either case.

script is basically:
Code:
#!/bin/zsh
restrictwacom.sh

export LD_LIBRARY_PATH=/home/me/Apps/Synfig/lib
/home/me/Apps/Synfig/bin/synfigstudio
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a shell script in start up of single user mode.. logan_the_wolverine Linux - Newbie 4 02-22-2012 10:21 AM
[SOLVED] Make script that runs program as another user with pass? LuxLuv Programming 4 06-08-2010 10:34 AM
How to program shell script to automate mass user account creation? EsAsher Linux - General 2 06-30-2007 08:41 AM
How do I know if a program was installed correctly? glenn69 Linux - Newbie 3 04-23-2004 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:17 AM.

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