site  contact  subhomenews

Detach child process from parent

September 08, 2020 — BarryK

EasyOS uses the traditional Puppy Linux method of launching the tray applets, such as the volume control, NetworkManager applet and CPU-temperature applet. These applets are found in /root/Startup and are executed by /usr/sbin/delayedrun, which in turn is launched from /root/.xinitrc when Xorg starts.

I think that this method is still supported in Puppy, but deprecated in favour of the applets being in /etc/xdg/autostart and /root/.config/autostart.

/usr/sbin/delayedrun has this code near the end of the script:

if [ -d /root/Startup ];then
for a in /root/Startup/*
do
[ -x "$a" ] && $a &
sleep 0.2
done
fi

This is OK, except over the years it has bothered me that 'ps' shows 'delayedrun' as still running, after it has finished. Executing 'pstree' shows the situation, here is part of the output:

     |-delayedrun---blueman-applet-+-{dconf worker}
| |-{gdbus}
| |-{gmain}
| `-{python3:disk$0}
|-delayedrun---yad
|-delayedrun---freememapplet_t
|-delayedrun---nm-applet-+-{dconf worker}
| |-{gdbus}
| `-{gmain}
|-delayedrun---pmcputemp
|-delayedrun---pnmixer

Those applets are children of 'delayedrun', so 'delayedrun' is still shown as "running". There is nothing wrong with that, but aesthetically it would seem nice if 'delayedrun' could be completely dismissed.

After an Internet search, I implemented this in delayedrun:

if [ -d /root/Startup ];then
for a in /root/Startup/*
do
if [ -x "$a" ];then
disown -h $! #note, -h will disable forwarding SIGHUP.
fi
sleep 0.2
done
fi

Now, 'pstree' shows that 'delayedrun' has gone, each applet is a child of 'init', for example:

     |-blueman-applet-+-{dconf worker}
| |-{gdbus}
| |-{gmain}
| `-{python3:disk$0}

The applets still work, terminate and startup as expected. The "-h" doesn't seem to do anything, works just as well without it.

The problem is that 'disown' is a bash builtin, not available in busybox ash, nor even with /bin/sh if it is symlinked to bash. However, I found that this works the same:

if [ -d /root/Startup ];then
for a in /root/Startup/*
do
if [ -x "$a" ];then
setsid --fork $a
fi
sleep 0.2
done
fi

I wrote about 'setsid' recently, used in the 'initrd':

https://bkhome.org/news/202008/fix-for-devtty-in-initrd.html

'setsid' is a busybox utility, also in 'util-linux' package.

I will implement the 'setsid' method in 'delayedrun'. Not that it really needs to be done, just, as I stated, aesthetically pleasing. 

Here are some relevant discussions:

https://unix.stackexchange.com/questions/269805/how-can-i-detach-a-process-from-a-bash-script

https://superuser.com/questions/178587/how-do-i-detach-a-process-from-terminal-entirely

...though, I don't want to detach from the controlling terminal, just from the parent script. If anyone knows of a potential downside to doing this, let me know!

EDIT 2020-09-09:
James (jamesbond in the forums) sent me an email, quoting:

The solution is quite simple, no setsid or bash hackery needed.

Instead of the original code

if [ -d /root/Startup ];then
 for a in /root/Startup/*
 do
  [ -x "$a" ] && $a &
  sleep 0.2
 done
fi

Do it like this:

if [ -d /root/Startup ];then
 for a in /root/Startup/*
 do
  if [ -x "$a" ]; then
     $a &
     sleep 0.2
  fi
 done
fi

Changing the short form to proper if/then block is what fixes it.

Gosh, that works! My understanding has always been that there is no underlying difference between the two forms. Which seems to be the general understanding, for example this discussion:

https://unix.stackexchange.com/questions/472137/whats-the-difference-between-using-if-condition-then-and-just-condition

I'm astonished. Thanks James!   



 

Tags: easy

Deutsche langpack updated for Easy 2.4.1

September 07, 2020 — BarryK

Lutz (L16L on the forum) has posted some updated German translations for EasyOS 2.4.1:

https://easyos.org/forum/showthread.php?tid=130

They are files 'easy-containers.mo', 'easy-rollback.mo' and 'easy-update.mo' in /usr/share/locale/de/LC_MESSAGES, file 'menu_strings.de' in /usr/share/sss/menu_strings and file 'script_strings.de' in /usr/share/sss/script_strings.

The PET is now 'langpack_de-20200906.pet'. Thanks for that! 

Tags: easy

Pristine first-boot erase more exceptions

September 05, 2020 — BarryK

The menu "Filesystem -> Audit -> Easy Version Control" runs an app that has a button to erase the current session. The same can also be achieved via menu "Shutdown -> Reboot, with rollback".

With Easy 2.4.1, there were exceptions introduced, so that it need not be a complete wipe of the the session.

I have now added CUPS setup, so the window has a new checkbox:

img1

Today I looked at the EasyOS Forum, and replied to some posts, after a couple of days elsewhere engaged -- working in the garden. Spring is here, in the Southern Hemisphere. 

Tags: easy

EasyOS version 2.4.1 released

August 30, 2020 — BarryK

Another exciting release! The last release announced at Distrowatch was 2.3, on May 30, 2020. Since then, as usual, there has been a hectic pace of development. Here is an announcement blurb, with highlights since 2.3:

EasyOS 2.4.1 has significant and exciting new features since version 2.3. This includes enhancements to "lockdown in RAM" as an alternative security strategy to containers, tools and strategies for debugging bootup in the initrd, automatic version update via an "update" icon on the desktop, and choice of settings to retain when erase the session.  There are many package changes, including built from Debian 10.5 DEBs and kernel bump to 5.4.59. Updated applications include SeaMonkey, Pupradio, fftag, ffplay-gtk, Pmcputemp and EasyDD. New apps include MATE Calc and iotop. Many infrastructure improvements and fixes -- too many to list, see the release notes.

Here are the release notes:

http://distro.ibiblio.org/easyos/amd64/releases/buster/2.4.1/release-notes-2.4.1.htm

Download English, French and German builds:

http://distro.ibiblio.org/easyos/amd64/releases/buster/2.4.1/

And if you need it, installation instructions:

http://distro.ibiblio.org/easyos/amd64/releases/buster/2.4.1/readme.htm

Here are some posts to show new feature highlights:

https://bkhome.org/news/202008/save-session-while-running-totally-in-ram.html

https://bkhome.org/news/202008/menu-changed-from-inline-to-cascading.html

https://bkhome.org/news/202008/keep-some-settings-when-erase-session.html

https://easyos.org/dev/guidelines-for-debugging-easyos.html

https://easyos.org/user/easy-version-upgrade-and-downgrade.html

EasyOS now has his own forum:

https://easyos.org/forum/

This is a tarball of woofQ, the build system used to create EasyOS:

http://distro.ibiblio.org/easyos/project/woof/woof-project-20200830.tar.gz

Kernel source, with patches and build scripts, is here:

http://distro.ibiblio.org/easyos/source/kernel/

Have fun! 

Tags: easy

Bugfix notes for the aborted 2.4 release

August 29, 2020 — BarryK

It wasn't online for very long, several hours, before I pulled it down, but if you do have it, there are notes here about manual fixes for a couple of the bugs:

https://easyos.org/forum/showthread.php?tid=119 

Tags: easy

EasyOS version 2.4 released - NOT

August 28, 2020 — BarryK

Oh cr*p, we have found two show-stopper bugs in 2.4. The release is withdrawn. Hopefully in a couple of days I will have fixed the bugs and will re-upload. Sorry about that!

Bugs fixed! Version 2.4.1 is released:

https://bkhome.org/news/202008/easyos-version-241-released.html 


Another exciting release! The last release announced at Distrowatch was 2.3, on May 30, 2020. Since then, as usual, there has been a hectic pace of development. Here is an announcement blurb, with highlights since 2.3:

EasyOS 2.4 has significant and exciting new features since version 2.3. This includes enhancements to "lockdown in RAM" as an alternative security strategy to containers, tools and strategies for debugging bootup in the initrd, automatic version update via an "update" icon on the desktop, and choice of settings to retain when erase the session.  There are many package changes, including built from Debian 10.5 DEBs and kernel bump to 5.4.59. Updated applications include SeaMonkey, Pupradio, fftag, ffplay-gtk, Pmcputemp and EasyDD. New apps include MATE Calc and iotop. Many infrastructure improvements and fixes -- too many to list, see the release notes.

Here are the release notes:

http://distro.ibiblio.org/easyos/amd64/releases/buster/2.4/release-notes-2.4.htm

Download English, French and German builds:

http://distro.ibiblio.org/easyos/amd64/releases/buster/2.4/

And if you need it, installation instructions:

http://distro.ibiblio.org/easyos/amd64/releases/buster/2.4/readme.htm

Here are some posts to show new feature highlights:

https://bkhome.org/news/202008/save-session-while-running-totally-in-ram.html

https://bkhome.org/news/202008/menu-changed-from-inline-to-cascading.html

https://bkhome.org/news/202008/keep-some-settings-when-erase-session.html

https://easyos.org/dev/guidelines-for-debugging-easyos.html

https://easyos.org/user/easy-version-upgrade-and-downgrade.html

EasyOS now has his own forum:

https://easyos.org/forum/

This is a tarball of woofQ, the build system used to create EasyOS:

http://distro.ibiblio.org/easyos/project/woof/woof-project-20200828.tar.gz

Kernel source, with patches and build scripts, is here:

http://distro.ibiblio.org/easyos/source/kernel/

Have fun! 

Tags: easy

Save session while running totally in RAM

August 25, 2020 — BarryK

There are two boot menu options, "Copy session to RAM & unmount all partitions" and "Copy session to RAM & disable all drives", lets call them lockdown modes #1 and #2.

I posted earlier, that the desktop now has an "update" icon, that you can click to perform automatic version update of your EasyOS installation:

img0

The menu now has a cascading structure, and I have changed the "Shutdown" layout:

img1

As I have posted about earlier, if we choose "Reboot, lockdown in RAM", we get a window:

img2

If we choose "Copy session to RAM & disable drives", and tick the "Permanent" checkbox, all future bootups will be in that mode.

In this totally-running-in-RAM mode, there are various restrictions. One restriction is no support for containers, as totally-running-in-RAM is to be considered as an alternative security strategy. After rebooting in this "lockdown #2" mode, there is an information popup:

img5

Lockdown has also removed the "update" icon, replaced it with a "save" icon. Here are the icons:

img4

So, you cannot update the version in this lockdown mode, instead there is an icon to save the session. Clicking on "save":

img6

...because, this is lockdown #2, drives disabled. You have to physically replug the drive to make it accessible, so doing that:

img7

...click "OK", and the session is saved!

It is not just the '.session' folder that gets saved. The working-partition has folders 'containers', 'home', 'releases', 'sfs' and '.session'. If you had taken screen snapshots, or downloaded via the the web browser, the default path is somewhere under the 'home' folder (which is '/home' in the file manager). Or, if you had downloaded a SFS file, it would be under the 'sfs' folder. Hence, those folders are also saved.

Yes, "sfsget" icon is still on the desktop, but as containers are not supported, you will only be offered to install an SFS as a layer on the main desktop.

No container support, but you still have good-old "spot", so you can run the browser, for example, as user "spot".

Note, you are not asked if you want to save the session when you shutdown. It is only done via the "save" icon. The lockdown modes are to be considered as defaulting to leaving no foot print on your computer. Only save if you want to, or, if there is just a file that you want to save, no need to save the entire session -- just replug the drive, mount the partition, copy the file to it, unmount the partition, and unplug the drive.   

Tags: easy

Lots of little improvements and fixes

August 23, 2020 — BarryK

Working toward releasing Easy 2.4, I have been improving and fixing, and neglecting to document. OK, better post changes just made...

L16L has updated MoManager, see:

https://easyos.org/forum/showthread.php?tid=104

There was a comment about gParted having limitations as being an older version:

https://easyos.org/forum/showthread.php?tid=110

I had downgraded gParted, so now have reverted to version 1.0.0. At the time, I was grumpy that gParted has abandoned gtk2, so went back to the last gtk2 release. But, have to live with the reality.

L16L and esmourguit have posted updates for de and fr langpacks.   


Tags: easy