+ Auf Thema antworten
Seite 1 von 3 1 2 3 LetzteLetzte
Zeige Ergebnis 1 bis 10 von 25

Thema: userscript 0.21 08/01/25 - permanently include your mods

  1. #1

    Standard userscript 0.21 08/01/25 - permanently include your mods

    Version 0.21 is just down below.
    Hello,

    this is a little package giving you the possibility to insert in an easy way own modifications at the NAS. As long as there's no alternative firmware or the promised development tools from Raidsonic i suppose it's quite useful.
    The script will run different scripts at every NAS-boottime, so all your modifications will last even after poweroff.
    It's modular and indented to be community supported. I won't give you the scripts (oh, maybe i will) but am willing to correct errors on "userscript". So please report any failures here and i'll try to fix it.

    Installation:
    Place package into public/applications/new_software/ and reboot. This will create a new folder public/applications/userscript/

    Content:
    init - is started at NAS-Boot and does ...
    init.us - ... enable starting this. It runs after all other bootstuff is done, so your mods will be the last who come and not overriden by the flashcontent
    example/* - some examples (see below), more to come from community
    scripts/ - here your scripts have to be placed. pure textfiles are enough (they will get execute-bit automaticaly). Two conditions: it must be bash-scripts (including "#!/bin/sh") and the name must end with ".sh" eg "proftpd.sh"
    config/ - it's indented to contain your config-files, which will be writen to the NAS (look at included proftp-script)

    Examples included:
    linkhddapp.sh / linkroot.sh - makes symlinks of /usr/hddapp/ and / under userscript/hddapp/ and userscript/root/ - useful at development. The config-files for the NAS-services are located under hddapp/etc/, so it's good for building your own configs.

    unlinkhddapp.sh / unlinkroot.sh - what to you thing? it removes the links

    proftpd.sh - exchanges ftpserver-settings with userscript/config/proftpd.conf and restarts the ftpserver. Obviously needs a conf located there. Use one of these at userscript/examples/config/. CAUTION: Get the right one depending on your system - eg. if your system is located at /mnt/md1 (raid-systems), get proftpd.conf.md1.
    copy your needed conf to userscript/config/ and rename it to proftpd.conf!

    Download at RapidShare (deleted - please use Version 0.2)

    greetz
    skara

    PS: Some short "thanks" shows me, there's an interessed on it at our nongerman visitors. So if you want us to write more english give any feedback (even about our lack of english knowledge )
    Geändert von skara (05.05.2008 um 10:17 Uhr) Grund: fixed link to latest version

  2. #2

    Standard

    New Version 0.21
    /edit: v0.21 is a minor fix to v0.2. Error in examples/conf/proftp.conf.md1 is fixed. No need to get the new version, if you don't have RAID or don't use my exampleconfig!

    Changes:
    init.us is called without backup_button-stuff (but at the end though).

    New Example:
    example/path - changes $PATH-variable to fit your own bin-directories. move this script to userscript/scripts/
    example/config/path - the needed ressourcefile. insert your wished path. multiple pathes are possible. simply separat by : - eg "/bin:/sbin". This file has to be moved to userscript/config

    greetz
    skara

  3. #3

    Standard

    Nice work Skara. It's good to see that the community is improving the SW on NAS4220. Raidsonic support is next to nothing.

    Could some one who speaks German translate the spindown fix (with USB flash drive) and other useful scripts to English. I have used Babel Fish but the translation isn't so good

  4. #4
    Experte gmeyer wird schon bald berühmt werden
    Registriert seit
    26.12.2007
    Ort
    Mutterstadt
    Beiträge
    1.198

    Standard

    Hi

    1.) install the actual firmware (2.6.0.IB.1.RS.1)

    2.) telnet to box, login as root
    (if telnet-server not enabled, enable it with http://ip-of-the-box/cgi/telnet/telnet.cgi )

    3.) prepare USB-Stick
    insert USB-Stick, should be automatically detected as /dev/sda1 and mounted under /mnt/usb1 (check with "mount").
    format it with ext2:
    Code:
    umount /dev/sda1 
    mke2fs /dev/sda1 
    mount /dev/sda1 /mnt/usb1
    4.) create script:
    "cd /mnt/md1/public"
    "vi SpindownFix.sh"
    switch to insert-mode ("i"), copy&paste the following code:
    Code:
    Code:
    #!/bin/sh 
    # IB-NAS4220: move /system to USB-Stick to allow HD spindown 
    # 
    # History: 
    # 04.12.2007 - V1.0 
    # 06.01.2008 - V1.1 
    #            - ensure propper mounts at start 
    
    #prepare to umount /system 
    echo "stopping tasks ..." 
    killall lpd 
    killall crond 
    /system/hddapp/etc/rc.d/S80samba.sh stop 
    /system/hddapp/etc/rc.d/S85nfs.sh stop 
    /system/hddapp/etc/rc.d/S91proftpd.sh stop 
    killall slotDiskButton 
    killall mdadm 
    
    # ensure proper mounts at start 
    echo "ensure proper mounts at start ..." 
    sync 
    umount /dev/md0 
    umount /dev/sda1 
    mount /dev/md0 /system 
    mount /dev/sda1 /mnt/usb1 
    #mount 
    
    #delete USB-Stick and copy /system to USB-Stick 
    echo "copying /system to USB-Stick ..." 
    rm -rf /mnt/usb1/* 
    (cd /system; tar cf - .) | (cd /mnt/usb1; tar xf -) 
    sync 
    
    #umount /system and mount USB-Stick 
    cd / 
    echo "remount /system ..." 
    umount /mnt/usb1 
    umount /system 
    mount /dev/sda1 /system 
    #mount 
    
    #restart tasks 
    echo "restarting tasks ..." 
    /system/hddapp/bin/lpd 
    /usr/sbin/crond 
    /system/hddapp/etc/rc.d/S80samba.sh start 
    /system/hddapp/etc/rc.d/S85nfs.sh start 
    /system/hddapp/etc/rc.d/S91proftpd.sh start 
    /usr/sausalito/handlers/base/raid/slotDiskButton 
    mdadm --monitor --program=/usr/sausalito/handlers/base/raid/monitor --delay=5 /dev/md0 /dev/md1 & 
    
    #disable bt_scheduling_start in crontab 
    crontab -l | sed 's/\*\/5/#\*\/5/' > /var/tmp/cronjobs 
    crontab /var/tmp/cronjobs 
    
    # set HD spindown to 5 minutes 
    hdparm -S60 /dev/hda 
    hdparm -S60 /dev/hdb
    press <ESC>, ":wq" to save

    5.) "chmod 755 SpindownFix.sh" to make script exceutable

    6.) execute "/mnt/md1/public/SpindownFix.sh", check output.

    I hope, it's better than "Babel Fish" ;-)

    Regards,
    Gerhard
    NAS1: IB-NAS2000, Rev. B (verkauft)
    HDD: 1x500GB Seagate ST3500630A
    NAS2: IB-NAS4220-B, Board Rev. V1.2
    HDD: 2x500GB Seagate ST3500630AS, Raid1, ext3
    FW: 2.6.3.2
    Dauerläufer, Spindown ohne USB-Stick ok
    NAS3: IB-NAS4220-B, Board Rev. V1.2
    HDD: 2x160GB Seagate ST3160815AS, Raid1, ext3
    FW: 2.6.3.2
    Testgerät, Spindown ohne USB-Stick ok
    NAS4: Synology DS209+, Board Rev. ?
    HDD: 2x1TB Seagate ST31000340AS, HDD-FW: SD1A, Raid1, ext3
    FW: DSM 3.0-1285 (Beta)
    LAN:
    2 x D-Link 8Port Gigabitswitch DGS-1008D

  5. #5

    Standard

    Zitat Zitat von Zuah
    Nice work Skara. It's good to see that the community is improving the SW on NAS4220. Raidsonic support is next to nothing.
    Could some one who speaks German translate the spindown fix (with USB flash drive) and other useful scripts to English.
    There are no other scripts at the moment. Noone else is willing to create one or to share it's knowledge - i don't know.
    My sample should be enough for your own investigations. If you do any others, feel free to share it here.

    greetz
    skara

  6. #6

    Standard

    Thanks to blkhawk from #nas4220 on freenode which provide it its script ot me. I update it a bit as I found it sexy.

    This remove the bit_torrent client to access HDD every 5 min. And allow to spindown the HDD if needed.

    Add using the userscript package the following script:

    #!/bin/sh
    crontab -l | grep -v bt_scheduling | crontab -

    Warning: No more bittorrent after it !

  7. #7

    Standard

    Skara,
    Are you able to explain how I can combine using your userscript with the spindown fix? It seems that with the system mounted on USB I cannot make any changes to the system, including the web interface (things won’t save).

    Is it the case that with system mounted on USB, I need to unplug USB, boot as normal, make the changes, save and reboot. Then reformat/copy system back onto USB as set out above? Is there a quicker way to do this eg what steps can I skip if I already have the USB system working?

  8. #8

    Standard

    gmeyer - he who worked out this solution - actually translated it's knowledge into the wiki
    It includes the necessary steps for including it with userscript.

    greetz
    skara
    Ob jemand das Wiki oder die Suche benutzt hat, merkt man an den Fragen.
    Ob die Lösung dort drin steht, merkt man an den Antworten (3501051808)


    Fragen nach sinnvollen Begriffen zum Suchen werden immer beantwortet. Um alles vorgekaut zu bekommen teile ich aber auf Anfrage gerne meinen Stundensatz mit!

  9. #9

    Standard

    Thanks, although if I'm reading that correctly it just says that with the system mounted on USB you need to do everything twice, once with the stick and once without.

    My problem seems to be that it doesn't save when mounted from the stick at all, so each time I make a change I have to remove the stick, reboot, make the change, reboot, insert stick, reformat then recopy the file system across!

    Is there an easier way is what I'm asking! If this is what everyone else is doing then I will just up with it!

  10. #10

    Standard

    Now i understand.
    As far as i know all the changes should be done on the stick, if you use this script. (But i'm not sure)

    But this problem seems to be offtopic in here. Please open a new thread if the problem resists.

    greetz
    skara
    Ob jemand das Wiki oder die Suche benutzt hat, merkt man an den Fragen.
    Ob die Lösung dort drin steht, merkt man an den Antworten (3501051808)


    Fragen nach sinnvollen Begriffen zum Suchen werden immer beantwortet. Um alles vorgekaut zu bekommen teile ich aber auf Anfrage gerne meinen Stundensatz mit!

+ Auf Thema antworten

Ähnliche Themen

  1. userscript 0.21 - 25.01.- Übernahme von Nutzereinstellungen
    Von skara im Forum Packages, Tools und Erweiterungen
    Antworten: 42
    Letzter Beitrag: 28.02.2009, 16:13
  2. Formatierung von Platte bleibt bei 0%
    Von saschapi im Forum Komplexe Lösungen und Erfahrungsberichte
    Antworten: 23
    Letzter Beitrag: 21.02.2008, 17:46
  3. Interview mit Raidsonic am 17.01.08
    Von daddel80 im Forum Infos
    Antworten: 17
    Letzter Beitrag: 14.02.2008, 10:35
  4. UserScript l Hilfe
    Von Skopecek im Forum Packages, Tools und Erweiterungen
    Antworten: 11
    Letzter Beitrag: 11.02.2008, 13:19

Stichworte

Lesezeichen

Forumregeln

  • Es ist dir nicht erlaubt, neue Themen zu verfassen.
  • Es ist dir nicht erlaubt, auf Beiträge zu antworten.
  • Es ist dir nicht erlaubt, Anhänge hochzuladen.
  • Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.