launching a script on start-upForum: Other Help Topics Topic: launching a script on start-up started by: duch Posted by duch on May 25 2006,20:01
Hi all,first of all i'm a complete noob with DSL so apologize for any stupid questions... I have a spare PC which i'd liked to transform into a backup unit. Since i want my system to be independent from my data, a live CD distro like DSL seems to be an ideal choice. And since i don't want to waste an IDE port for a CD drive, booting from a USB key seems to be an even better choice. Now, here is what i'd like to do: a simple startup script that would mount the SMB shares available on my network and do a rsync on the unit hard drive. Ideally, i wouldn't like to do a remaster each time i need to add a SMB share so it would be nice if this script could be a simple file on the USB key so that i could edit it on another computer an stick it back in the unit when i want to use it. Could you please guide me into this project? should i use Mkmydsl? is rsync available in dsl? should i use another usb key to store my script (and restore it thanks to a cheatcode?) or could it be on the same key? how can i store my IP settings on my key? Many questions might already been answered but i couldn't find the answer. Thanks for your help Posted by cbagger01 on May 27 2006,17:48
Yes for a remastered livecd, but you don't need to use mkmydsl if you are going to do a USB installation because the USB stick is read/write. All you need to do is copy your extensions over to the USB stick and they will auto-install at boot time.
Same key Use the DSL backup/restore process. Edit your default APPEND line in the SYSLINUX.CFG file to add "nodhcp" to the line. Then add lines to your /opt/bootlocal.sh file to load with static IP and save the file via the backup/restore process. See the wiki for more info Posted by duch on May 28 2006,16:02
thanks for your help.Do you mean i need to create an extension with my script, or is it only to add rsync? If i don't need to build my script as an extension, where should i store it (bit lost sorry) about the backup/restore process, the wiki says it requires a cheatcode, how could i make it automatically every time the computer boots? EDIT : OK, i got the idea about IP settings (i'm a bit slow sorry), my default APPEND line contains the default cheatcodes used by DSL at startup so adding nodhcp and sda1 as a restore path will do the trick ;) with this i'll also be able to start as runlevel 2 only (but will my extension be loaded?) and run my script thanks to the bootlocal.sh script Posted by cbagger01 on May 30 2006,00:27
You can do it a number of ways:1) Create a small extension with your script inside. If you place your script file in /home/dsl or in /opt you can make a simple extensionname.tar.gz type extension. 2) Save the script directly inside the root directory of your read/write boot device (IE: where the SYSLINUX.CFG file is located). After booting, you can find it at /cdrom/scriptname Keep in mind that the USB drive's native file system is MSDOS FAT, so you may need to copy and/or "chmod" the script in order to make it an executable program again. 3) Save it inside your backup/restore system. If you store it in /home/dsl, it will automatically be backed up by default. You can also store it in other locations if you include the file's path inside your /home/dsl/.filetool.lst This is a text file that contains a list of files and directories that get backed up. To see "hidden" files in linux (filenames that begin with a "."), press the "H" button at the top of the emelfm (filemanager) window pane. 4) Do a true KNOPPIX-Style remaster. Relatively painful and complicated, but still do-able. You can start as runlevel 2 by adding " 2 " to your append line. The MyDSL extensions and the backup/restore will still function. |