26

December
2012

Special files in Slax modules

In older Slax version (6.x) all modules could include rc script in /etc/rc.d/ which get executed even during 'activate' command. This is not the case for Slax 7, there is no such functionality so far. I'd like to make it a bit differently.

This is not implemented yet, but I'm thinking about something like this: the directory /run in each Slax module could include several special files. For example, a special file /run/activate.sh could be a script which is to be executed when the module is activated by user while running Slax. Other file could be /run/deactivate.sh, which would be executed when the module is deactivated (perhaps to properly shutdown the application and close all files so the module could be even deactivated at all). Those scripts could be also executed during system startup, so you don't need to have your own rc scripts in /etc/rc.d/ or /etc/init.d/

The main idea is that /run is overmounted by tmpfs in Slax anyway, so if the module has files in /run then those won't be visible in Slax' root filesystem at all, making them effectively hidden, only accessed through /mnt/live/memory/bundles/123-module.sb/run/* so only Slax could understand them and execute them as needed.

User comments
Mark De Silva 2012-12-26 07:55

Seems like an excellect idea. There is definitely a need to run scripts on activation/deactivation, eg: sendmail, postgresql, mysql. etc where you have to add a user/password/group to the relevant files in /etc.If you just create the etc/passwd, etc/shadow, etc/group within your module it can wipe out the system's original files and render the system unuseable. It works in the txz packages because it can be set in part of the install/doinst.sh.

Also to have scripts on deactivation is something I've been wanting for a long time. The workarounds and dirty hacks I've had to implement with Slax6 to achieve similar functionality was most time consuming.

Any time line on when the run/activate.sh and run/deactivate.sh will be deployed?

Along with this functionality, I sincerly hope the PXE boot comes back into play - its extremely useful, especially where slax is deployed over the cloud or in labs for classroom learning and for cluster computing using purely slax (or slax derevatives) which I gave a talk on earlier this year at BioIT Asia.

Mark De Silva 2012-12-26 08:14

Just to add that this run/ is just like the install/ with the doinst.sh in the Slackware txz/tgz packages I suppose - I fully support this.

Lecturer 2012-12-26 19:21

Even i hope PXE boot comes soon to slax 7 it is really help full in our college lab as its helpfull for teaching students about server, please make PXE boot as soon as possible.
Eagerly waiting for it.

I thank you from all our staff for giving us such a great OS .

Tomas M 2012-12-26 19:39

Are you requesting PXE support as a client or server? In Slax 6, both was available. But now I am thinking about only Slax 7 as PXE client - that means, it would boot over network but you would have to start the pxe server yourself somehow.

Lecturer 2012-12-26 20:27

Actualy there no proper server facility in our lab they don't maintain it,
It would be great if you give both client & server support.
I used to run server which ever pc I sit becomes server and instruct students.

Thank you

Mark De Silva 2012-12-27 00:44

I agree - server and client is important. In my talk earlier this year, I demostrated how we used slax to rapidly build a cluster out of a PC lab during their low usages hours to do large sequence analysis. One slax server acts as the master PXE and the rest boot off it so all have the same modules and environment setup. Also as Lecturer says, for regular classroom use its invaluable - set up one PC, let the students boot off from it and everyone is ready for class - no issues with drivers or non responding applications etc.

jcsoh 2012-12-27 02:12

http://www.phoronix.com/scan.php?page=article&item=slax_internal_process&num=1

Article by Tomas on Slax 7 - a brief introduction to how slax 7 works.

Russell Hernandez 2012-12-27 06:37

@jcsoh
@Thomas M

I guess that article in phoronix proves that the documentation section should be done.

jcsoh 2012-12-27 07:16

@ Russell

Tomas mentioned an e book on slax internal.
For a start he could just put a copy of the articel on slax documentation (assuming the copyright is not assigned to phoronix due to publishing).

Tomas M 2012-12-27 10:39

I wrote Slax internals documentation and I allowed phoronix to publish it in exchange for some publicity :) I'll add it to Slax documentation soon.

陈所长 2012-12-27 13:27

How can i use the GRUB boot Slax,Now i can enter the the Slax command line mode.
eg.
title Slax
kernel /Slax/boot/vmlinuz
initrd /Slax/boot/initrfs.img

Thanks!

jcsoh 2012-12-27 13:53

How can i use the GRUB boot Slax,
http://old.slax.org/forum.php?action=view&parentID=83073

Prcek 2012-12-27 21:02

Install Slax on your drive with the bootinst.sh script. Copy the MBR with the Slax bootloader to a file (dd if=/dev/sdX of=/tmp/slax_boot.img bs=512 count=1). Copy the file slax_boot.img (the name can be anything) to your drive with Slax (for example /slax/slax_boot.img) and then install GRUB. The GRUB installation will overwrite the MBR on drive /dev/sdX (sdX is your drive with Slax, for example sdb or sdc), but you have the data saved in slax_boot.img. Now you can configure GRUB to load the slax_boot.img:

title Slax
root (hd0,0) # put here your partition on which you have Slax
chainloader /slax/slax_boot.img

Joel 2012-12-28 03:33

How can I have 'Num Lock' on boot?
Thanks for your excelent Slax 7

jcsoh 2012-12-28 03:52

@ Joel
Kde Menu
System
System Setting
Input Device
Keyboard
Below have option - Numlock on on kde startup etc

tdmsilvino 2012-12-28 09:18

@Tomas M, the use of these scripts in /run is a great idea and it would help us to create users and change file permissions where needed.

Now I have a question on another subject. Is it possible to keep the two versions of Slax in the same pendrive?
I was trying to do the following: I would like to keep the 32bits version in /slax32 and the 64bits version in /slax64 and then I would use grub to boot the two different systems from the same pendrive. I changed the directory names in the files bootinst.bat and syslinux.cfg and I was able to boot the system but then it stoped after the kernel messages in the part that reads "Looking for Slax data in /slax ....."

Tomas M 2012-12-28 09:35

@tdmsilvino: after you made proper modifications in bootinst.bat and syslinux.cfg, add 'from=slax32' or 'from=slax64' as a boot parameter.

tdmsilvino 2012-12-28 09:48

@Tomas M, I just did that. It works fine. Tks for the reply.

Jayaram 2012-12-28 16:03

I think that priority is to be given to uploading the "activtion and deactivation codes" before uloading more modules so that the user can download and activate the modules without waiting eagerly for long.

jcsoh 2012-12-28 17:23

"so that the user can download and activate the modules without waiting eagerly for long."

No waiting is necessary . For now just download to your media and use slax -activate to activate in your media.

Emanuele 2012-12-29 00:34

I agree with Mark, PXE Server support on Slax is amazing!
And some time is important have this functionality ouf of the box

Jayaram 2012-12-29 13:36

Jshoh, I downloaded 275-sc.sb to Home>Downloads. How can I activate this module ? Right click does not open a window with "activate" command; neither does the command "slax-activate 275-sc.sb " or "activate 275-sc.sb " in the terminal opened there work. How to activate it then ?

Jayaram 2012-12-29 13:44

jcsoh, Sorry for the wrong spelling I used..... Please illustrate "activation" with an example of .sb module. Thanks.

Manfred 2012-12-29 17:14

"slax activate 275-sc.sb" without a hyphen between slax and activate

jcsoh 2012-12-30 13:28

@ Jayaram
Sorry I didn't read this thread for a while (I assumed no further new postings).
Click on slax bundle /module to activate no longer work (this is a regression from slax 6). You need to use a console. Yup.

Open a console where the bundle is , say it named mybundle.sb
Then type
slax activate mybundle.sb to activate
slax deactivate mybundle.sb to deactivate

You can also use wildcards, for eg
slax activate m*.sb to activate will work if there is no earlier module that fits the wildcard criteria , or to be safer
slax activate myb*.sb

But to avoid typing error just copy and paste the filename from the console.
To list out the files type
ls

Jayaram 2012-12-30 17:10

Thanks jcsoh, It worked !!

Mark De Silva 2013-01-04 00:18

@Tomas,

Sorry I haven't tried this myself, but has the /run/{activate|deactivate}.sh been implemented in slax 7.0.3?

Tomas M 2013-01-04 01:27

Nope I forgot to do that. Will be in 7.0.4 next week

Mark De Silva 2013-01-04 02:03

Thanks!

representer 2013-01-17 06:48

Sorry for interruption. I need to modify initrfs.img file.
To be more specific I tried to add /lib/modules/..../drivers/net folder to it so I could boot slax over PXE server. I realized that initrfs.img is a LZMA compressed cpio.
So I decompressed it using 7zip. then I used cpio to extract files. "cpio -ivd < initrfs"
I added the folder and created a new cpio. "find . -print -depth | cpio -ov > tree.cpio "
Then I replaced te initrfs.img.
But I receive kernel panic. Cannot find ramdisk image .... and so on.
Any ideas?

bSAsVufmOiDY 2013-02-16 21:48

Dear Shaheen,thanks for your intrust,You can join from any city or cutrony you are in,All you have to do is get register and take online training from us.You must contact office : 0992-342940 / 0331-9700006We guide you with further processRegards