if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then

#1 Post by s243a »

I don't understand what the following test condtion does

Code: Select all

if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then

in the palemoon script:
/usr/local/bin/palemoon-plugin-container.sh

Here is the full code:

Code: Select all

#!/bin/sh

PMDIR=''
if grep -q ' sse2 ' /proc/cpuinfo; then
	[ -x /opt/palemoon/palemoon ] && PMDIR=/opt/palemoon
else
	[ -x /usr/local/palemoon/palemoon ] && PMDIR=/usr/local/palemoon
fi

if [ -n "$PMDIR" ];then
	PMLINK="$(which palemoon 2>/dev/null)"
	if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then
		if [ -h $PMLINK ] \
		  && [ "$(basename $(readlink $PMLINK))" = 'palemoon.sh' ];then
			export LC_ALL=C
			exec /usr/lib/glibc219/lib/ld-linux.so.2 --library-path /usr/lib/glibc219/lib:/usr/lib/glibc219/usr/lib:/usr/lib/glibc219/libstdc++:/usr/X11R7/lib:$PMDIR $PMDIR/plugin-container_exec "$@" #exec avoids segfault after flashplayer
		fi
	fi
fi

and this comes with the version of palemoon found in the installer pet for superlupu4.

What I want to know is when will the following line of code be executed

Code: Select all

exec /usr/lib/glibc219/lib/ld-linux.so.2 --library-path /usr/lib/glibc219/lib:/usr/lib/glibc219/usr/lib:/usr/lib/glibc219/libstdc++:/usr/X11R7/lib:$PMDIR $PMDIR/plugin-container_exec "$@" #exec avoids segfault after flashplayer
because if this code never gets executed then I can see why youtube is crashing with a no child process error.
Last edited by s243a on Sat 23 Dec 2017, 11:03, edited 1 time in total.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

Re: if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then

#2 Post by MochiMoppel »

s243a wrote:I don't understand what the following test condtion does

Code: Select all

if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then
If variable "$PMLINK" is not empty and file /opt/palemoon/plugin-container_exec exists and is executable; then...

The earlier line PMDIR=/opt/palemoon makes no sense to me. Why did the script check for the installation directory and then ignores whatever the result and hardcodes the directory?
What I want to know is when will the following line of code be executed

Code: Select all

exec /usr/lib/glibc219/lib/ld-linux.so.2 --library-path /usr/lib/glibc219/lib:/usr/lib/glibc219/usr/lib:/usr/lib/glibc219/libstdc++:/usr/X11R7/lib:$PMDIR $PMDIR/plugin-container_exec "$@" #exec avoids segfault after flashplayer
Executed
if a symlink named palemoon exists in the $PATH and this symlink points to an executable file palemoon.sh
and
if executable file /opt/palemoon/plugin-container_exec exists
and of course
if the long exec line is valid code

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Re: if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then

#3 Post by s243a »

MochiMoppel wrote:
s243a wrote:I don't understand what the following test condtion does

Code: Select all

if [ -n "$PMLINK" -a -x $PMDIR/plugin-container_exec ];then
If variable "$PMLINK" is not empty and file /opt/palemoon/plugin-container_exec exists and is executable; then...
Thankyou :)
The earlier line PMDIR=/opt/palemoon makes no sense to me. Why did the script check for the installation directory and then ignores whatever the result and hardcodes the directory?
That might have been me that put that there. I didn't think the test for the installation directory was working. I deleted it in the above post to avoid confusion.
What I want to know is when will the following line of code be executed

Code: Select all

exec /usr/lib/glibc219/lib/ld-linux.so.2 --library-path /usr/lib/glibc219/lib:/usr/lib/glibc219/usr/lib:/usr/lib/glibc219/libstdc++:/usr/X11R7/lib:$PMDIR $PMDIR/plugin-container_exec "$@" #exec avoids segfault after flashplayer
Executed
if a symlink named palemoon exists in the $PATH and this symlink points to an executable file palemoon.sh
and
if executable file /opt/palemoon/plugin-container_exec exists
and of course
if the long exec line is valid code

Post Reply