Light-Debian-Core-Live-CD-Wheezy + Porteus-Wheezy

For talk and support relating specifically to Puppy derivatives
Message
Author
User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#3981 Post by saintless »

anikin wrote:Hi Toni, Fred et al,
Could the issue be because sh is symlink to dash for you?
Yes, the problem in standard Debian with peasyglue was sh is link to dash.
How did you solve it? If you remeber, I had that issue in SID and reconfigured bash as default instead of dash. Shortly afterwards shellshock followed ... and I wonder if changing Debian default shell is the right thing to do. Can peasyglue be easily modded to work with dash? Debian has a script "checkbashisms", part of devscripts pkg.
- checkbashisms: check whether a /bin/sh script contains any common bash-specific contructs
https://packages.debian.org/wheezy/devscripts It's way above my level, though.
Hi, Anikin.
I didn't test peasyglue much but it started and worked with 3 pictures without issues.
I just deleted /bin/sh and made manually new /bin/sh link pointing to /bin/bash
The system works after several reboots without problem and still has sh link to bash.
Note I and Fred use Debian Wheezy for testing. Maybe something is changed in Sid.
Since Debian has configuration tool to change dash with bash I think it is OK to do it (for Wheezy at least).

Toni

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3982 Post by fredx181 »

Hi Toni,
For ffconvert after installing ffmpeg I get "Segmentation fault" error.
I had already ffmpeg installed, this version: 8:1.0.10-dmo1 (from deb-multimedia).
Also tested converting a video and works fine.

Note, the full install I have is not standard gnome or whatever.
I just once did a minimal wheezy install and added lots of packages.
Not much time for testing few days but I will continue soon.
No hurry, I'm also involved by lots of things besides computer these days.

Fred

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3983 Post by fredx181 »

Sorry, double post, seems like there's a problem posting but I noticed now it has arrived

Fred
Last edited by fredx181 on Mon 08 Dec 2014, 18:01, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3984 Post by fredx181 »

Double-double post, sorry
Fred

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3985 Post by fredx181 »

Hi Anikin,
Can peasyglue be easily modded to work with dash?
No, well anyway I can't, it's full of bashisms e.g. exporting a function like this:

Code: Select all

export -f GLUE
Fred

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#3986 Post by anikin »

Thank you, guys. It just occurred to me, that I can easily switch between them as needed. Use dash for safe browsing. If/when an app requires bash, do a quick reconfigure.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#3987 Post by saintless »

Hi, Anikin.

You can also add inside peasyglue script starting lines:

Code: Select all

cd /bin
ln -snf bash sh 
And last lines (before exit) to restore dash again.

Code: Select all

cd /bin
ln -snf dash sh 
This was fix from Fred for frisbee and pburn before we changed sh to bash and will save you manually configuring sh all the time.

Toni

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#3988 Post by anikin »

Hi Toni, Fred et al,

I'm doing some reading on dash vs bash. My understanding so far is this: The two should coexist in Debian. Dash (default) is dealing with low level, non-interactive system stuff, like init. Bash is taking care of user scripts. In theory if the following condition is met, there's no need to do anything - linking, or reconfiguring.
A Note About Bash Specific Scripts

It is recommend that to avoid errors with your own Bash-specific scripts you can use the shebang line as follows:
#!/usr/bin/env bash.
OR
#!/path/to/real/bash.binary
OR
#!/usr/local/bin/bash
http://www.cyberciti.biz/faq/debian-ubu ... inshshell/
http://bash.cyberciti.biz/guide/Shebang
Will this be enough to keep dash as default and have a workable solution for DD aps?

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3989 Post by fredx181 »

Hi Anikin,
Hi Toni, Fred et al,

I'm doing some reading on dash vs bash. My understanding so far is this: The two should coexist in Debian. Dash (default) is dealing with low level, non-interactive system stuff, like init. Bash is taking care of user scripts. In theory if the following condition is met, there's no need to do anything - linking, or reconfiguring.
.....
.....
http://www.cyberciti.biz/faq/debian-ubu ... inshshell/
http://bash.cyberciti.biz/guide/Shebang
Will this be enough to keep dash as default and have a workable solution for DD aps?
We have had this discussion about a year ago (don't take me wrong, I don't blame you for not having followed it at that time :) ).
It's just only a gtkdialog issue so it doesn't help to change shebang from #!/bin/sh to #!/bin/bash in a gtkdialog app.
So it really comes down to:
If there are bashisms in a gtkdialog script the only solution to make it work is the symlink sh > bash.
Hopefully there will be better solution but I'm afraid there is no, unless there comes new version of gtkdialog that solves this problem.

Fred

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#3990 Post by anikin »

Fred, I didn't realize it was gtkdialog related, sorry. I will follow Toni's advice and apply the fix, do you have a list of apps that will need it?

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3991 Post by fredx181 »

Hi Anikin,

From these I'm sure of:
pburn, desktop-editor, menumaker, frisbee, ffconvert, peasyglue, domyfile, domycommand, pavrecord, precord, mk-save.gtkdlg

But there could be some more, I only checked for "export -f ...."

Fred

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#3992 Post by anikin »

Hi Toni, Fred et al,

I'm confused, continue to confuse others, being stubborn and have mixed feelings ... blame gtkdialog. The fact is it has a "bashism" bug, you have proven it and it was also reported on Ubuntu forum. However, have a look at the picture below. I configured dash as default. Peasyglue doesn't start, the terminal shows an error. I then change the first line in peasyglue from #!/bin/sh to #!/bin/bash and it works without a hitch! I haven't yet checked other apps, though, but have a feeling, at least some of them, if not all, will work too.

edit
I could only find and test the following ones in my DD. They all work without issue, I didn't even modify them:
pfind
pburn
peasyglue
desktop-editor
frisbee
mk-save.gtkdlg
Attachments
shebang.jpeg
(47.73 KiB) Downloaded 426 times
Last edited by anikin on Thu 11 Dec 2014, 16:44, edited 2 times in total.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#3993 Post by saintless »

Hi, Fred.

Question when you have time to test and answer:
I have PM asking how to make reboot and shutdown work for user puppy without typing password for porteus-boot.
Reading Debian forums it is easy to do it in live-boot-2 and 3 this way (tested and works):
/etc/sudors:

Code: Select all

# User privilege specification
root   ALL=(ALL:ALL) ALL
puppy ALL=SHUTDOWN
puppy ALL=NOPASSWD: SHUTDOWN
/home/puppy/.jwmrc

Code: Select all

      <Program label="Reboot" icon="restart.png">
      sudo /sbin/shutdown -r now
      </Program>
      <Program label="Shutdown" icon="shutdown.png">
      sudo /sbin/shutdown -h now
      </Program>
But I can't make it work for porteus-boot.
Do you have some solution for this? A year ago you posted this but it does not work for me with porteus boot:

Code: Select all

chmod +s /sbin/halt
Actually works typing in terminal /sbin/halt but doesn't change the password prompt for obshutdown.
Removing gsu line from wmpoweroff and wmreboot also doesn't work.
I will post the solution for live-boot in howto thread later and if there is one for porteus-boot I will add it too.

Toni

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#3994 Post by saintless »

Thanks, Anikin.

Maybe simple changing !#/bin/bash will work for some applications but the safe and 100% working way for DD is reconfiguring sh to bash.
It is strange for me using sh link to bash creates problems in Sid. Maybe newer dash version does something that bash can't.

Toni

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#3995 Post by anikin »

Toni,

Sid doesn't have that problem, it was just a "bashism" issue. In this regard Wheezy and Sid are absolutely identical. I personally, will stick with dash - Debian's default shell both on my Sid and DD. BTW, FatDog's default shell is dash.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3996 Post by fredx181 »

Hi Toni, Anikin

I will look at the shutdown issue, get back later tonight.

Anikin,
Maybe you overlook something:
The fact that an application starts doesn't mean that all functions work properly.

Fred

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3997 Post by fredx181 »

Hi Toni,

Untested: (to tired at this moment)
For the /etc/sudoers file you could try something like this:

Code: Select all

puppy ALL=NOPASSWD: /sbin/shutdown -h now,/sbin/reboot,/sbin/poweroff
I think the problem for porteus-boot is because obshutdown executes wmpoweroff (which executes poweroff (symlink to halt) ) or wmreboot (which executes reboot (also symlink to halt) )
The sudoers example you provided refers to /sbin/shutdown, I think.

If you ask me, to avoid problems for other users (besides puppy), just do:

Code: Select all

chmod +s /sbin/halt
chmod +s /sbin/shutdown
And forget about editing /etc/sudoers

On OpenBox version I only have added +s (sticky bit) for /sbin/halt

Code: Select all

root@dog:~# ls -l /sbin/halt
-rwsrwsrwx 1 root root 13848 May 17  2014 /sbin/halt
But /sbin/shutdown doesn't work without having to use sudo, so good find.

Fred
Last edited by fredx181 on Thu 11 Dec 2014, 20:20, edited 1 time in total.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#3998 Post by saintless »

fredx181 wrote:Untested: (to tired at this moment)
Thank you, Fred!
I will do the testing tonight and tomorrow and I will add post about this in HowTo thread. In case someone else has the same question - link to the post will be enough.

Toni

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3999 Post by fredx181 »

Hi Anikin,
I'm confused, continue to confuse others, being stubborn and have mixed feelings ... blame gtkdialog.
Good, being stubborn :) until you are convinced of the truth.

To give some info,

Almost a year back DD had only frisbee as gtkdialog application.
For those who didn't use (or have) wireless it seemed that frisbee was working alright (it starts, shows network information, all seems well, right :wink: ).
But when trying to connect to a wireless network it didn't work at all.
This is just example (we experienced similar thing later also with pburn).
To be fair, after we 'solved' this by symlinking sh > bash, there was no reason anymore to test every other gtkdialog script if it possibly could have worked with symlink sh > dash (just played safe by changing to sh > bash and no "bashism" errors occured anymore).
I then change the first line in peasyglue from #!/bin/sh to #!/bin/bash
I'm not completely sure but I think this is the situation:
peasyglue is made for puppylinux, from what I know puppylinux has symlink sh > bash.
This way there's no difference if you use shebang #!/bin/sh or #!/bin/bash, both will use bash (as in DD now).
But if symlink sh > dash then: if shebang in peasyglue is #!/bin/sh it will complain about bashisms like "export -f ..." and the program doesn't even start.
Changing shebang to #!/bin/bash makes the program start but did you test if it works well? (to be honest I didn't test it, it could be exception,btw)
So, to summarize, a gtkdialog script that has bashisms inside needs sh > bash symlink no matter if shebang is #!/bin/sh or #!/bin/bash.

This is what I found out but I'm open for any improvement/solution on this matter.

Fred

anikin
Posts: 994
Joined: Thu 10 May 2012, 06:16

#4000 Post by anikin »

Yup, Fred, it gets a bit more complicated when doing the actual job. This is on DD, will check later how it goes on Sid.

Code: Select all

root@debian:~# peasyglue
sh: 1: GLUE: not found
EXIT="abort"
/usr/local/bin/peasyglue: line 310: syntax error near unexpected token `<'
/usr/local/bin/peasyglue: line 310: `abel></button>'
root@debian:~# 
Can you please have a look at this example by SFR in the FatDog thread http://murga-linux.com/puppy/viewtopic. ... 989#813989 and also see what technosaurus says. I was curious to know how FD handles gtkdialog with their own dash. I have also done quite a bit of research and reading, the general consensus is:
dash - very interesting; is there a safe way to change over to bash later?

You don't need to. Your default interactive shell remains bash, and the scripts that begin with #!/bin/bash will be unaffected as well. Only scripts that begin with #!/bin/sh will be redirected to dash, but these must not rely on bash-specific features by design.
In real life, though, a bit faulty gtkdialog, a bit lax user script and you have a confluence of issues. Here's required reading for good measure https://wiki.ubuntu.com/DashAsBinSh

Toni,

I want to completely remove the /.wallpapers folder and can't find out where it gets called from.

Post Reply