site  contact  subhomenews

empty and script utilities for Easy Containers

October 17, 2018 — BarryK

Prior to releasing Easy 0.9.7, there was a problem with launching apps in containers. For 'audacious' (music player) for example, a desktop icon is created, clicking on it runs /usr/sbin/ec-chroot-audacious, which has this in it:

ec-chroot audacious

...which failed, yet does work from a terminal window and from the JWM menu, as I reported here:

I fixed it for 0.9.7, like this:

urxvt -name eclaunch -iconic -e ec-chroot audacious

...where "-iconic" will launch the urxvt window minimized, and the name "eclaunch" is recognised by JWM to hide the window. This is clumsy, but it works.

Something in the 'ec-chroot-audacious' script is expecting the script to have been launched from a terminal. As it hasn't, in the case of ROX-Filer, there is a failure -- though interesting, can launch from the JWM menu OK.

I did some more research on this, and found this excellent discussion:

...the example is given of the 'ls' command. This checks if run in a terminal or in a script, and if the former, outputs with color-highlighted text. In a script, you just want plain text, for parsing purposes. So, that is the gist of the situation, something in 'ec-chroot-audacious' is performing a test, can't find a terminal, and aborts ...or something like that.

The above reference describes using the 'script' command, which fortuitously is a busybox applet. Yes, it works:

script -q -c "ec-chroot audacious" /dev/null

...clicking on the desktop icon, I can see the new pseudo-tty node getting creating in /dev/pts, and removed when quit audacious.

The above link also mentions a command named 'empty', project page here:

That also works:

empty -f ec-chroot audacious

...empty also created named pipes in /tmp, for input and output, though I don't see that I would need them.

Will think about it tonight, whether to use 'script' or 'empty'. If I can't find any downside to 'script', will probably go for that, as it is already available (in busybox). 

Here is another interesting read:  

EDIT 2018-10-17:
Decided to use 'empty'. It is now compiled in oe-qky-src:  

Tags: easy