Jump to content

theYinYeti

Members
  • Posts

    2151
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by theYinYeti

  1. I managed to solve my issue by reverting the way the script works (invert start and stop).

     

    So the script is now:

    #!/bin/bash
    #
    # chkconfig: 067 00 99
    # description: Unmount LVM partitions before it hangs the PC.
    
    ### BEGIN INIT INFO
    # Provides: safe-lvm-umount
    # Default-Start: 067 0 6 7
    # Short-Description: Unmount LVM partitions before it hangs the PC.
    ### END INIT INFO
    
    # Source function library
    . /etc/rc.d/init.d/functions
    
    function countLVM() {
    mount | grep /dev/mapper/ | wc -l
    }
    
    if [[ $(countLVM) -gt 0 ]]; then
    case "$1" in
    	start)
    		LVMmounts="$(mount | sed -nr 's#/dev/mapper/.* on (.*) type .*#\1#p')"
    		{ \
    			echo "$LVMmounts"
    			mount \
    			| grep -Ef <(sed 's#^.*$# on \0/.+ type #' <<<"$LVMmounts") \
    			| sed -nr 's#.* on (.*) type .*#\1#p'
    		} \
    		| sort -ru \
    		| while read mountpoint; do
    			action "Unmounting $mountpoint..." umount "$mountpoint"
    		done
    		gprintf "Unmounting LVM partitions..."
    		RETVAL=$(countLVM)
    		[ $RETVAL -eq 0 ] && success || failure
    		echo
    		;;
    	*)
    		gprintf "Usage: %s start\n" "$0"
    		;;
    esac
    fi
    
    exit ${RETVAL:-0}

     

    And accordingly:

    [yves@sedentaire ~]$ find /etc/rc.d -name "*safe-lvm-umount" | xargs ls -1
    /etc/rc.d/init.d/safe-lvm-umount
    /etc/rc.d/rc0.d/S00safe-lvm-umount
    /etc/rc.d/rc1.d/K99safe-lvm-umount
    /etc/rc.d/rc2.d/K99safe-lvm-umount
    /etc/rc.d/rc3.d/K99safe-lvm-umount
    /etc/rc.d/rc4.d/K99safe-lvm-umount
    /etc/rc.d/rc5.d/K99safe-lvm-umount
    /etc/rc.d/rc6.d/S00safe-lvm-umount
    /etc/rc.d/rc7.d/S00safe-lvm-umount

     

    Side-note: for some reason, “chkconfig --add safe-lvm-umount†made the link in rc3.d/ a S00 instead of a K99, and I had to correct it by hand…

    Now it works as intended. Still, I wish I understood why the former method did not!

     

    Yves.

  2. I want to integrate as much as possible with Mandriva's scripts, because I don't want to create a custom launcher for each and every desktop/panel combination that I, or my wife, or my son, use… That's why I try the rc.d route.

     

    My script is indeed enabled using chkconfig --add.

     

    Yves.

     

    Edit: it is enabled, since I see the “Usage: safe-lvm-umount stop†message in boot logs.

  3. I have a critical bug: https://qa.mandriva.com/show_bug.cgi?id=54143

    Using Mandriva 2010.0.

     

    To try and work around the problem for now, I created a LVM umount script:

    #!/bin/bash
    #
    # chkconfig: 12345 99 70
    # description: Unmount LVM partitions before it hangs the PC.
    
    ### BEGIN INIT INFO
    # Provides: safe-lvm-umount
    # Default-Start: 12345 1 2 3 4 5
    # Default-Stop: 06 0 6
    # Short-Description: Unmount LVM partitions before it hangs the PC.
    ### END INIT INFO
    
    # Source function library
    . /etc/rc.d/init.d/functions
    
    function countLVM() {
    mount | grep /dev/mapper/ | wc -l
    }
    
    if [[ $(countLVM) -gt 0 ]]; then
    case "$1" in
    	stop)
    		LVMmounts="$(mount | sed -nr 's#/dev/mapper/.* on (.*) type .*#\1#p')"
    		{ \
    			echo "$LVMmounts"
    			mount \
    			| grep -Ef <(sed 's#^.*$# on \0/.+ type #' <<<"$LVMmounts") \
    			| sed -nr 's#.* on (.*) type .*#\1#p'
    		} \
    		| sort -ru \
    		| while read mountpoint; do
    			action "Unmounting $mountpoint..." umount "$mountpoint"
    		done
    		gprintf "Unmounting LVM partitions..."
    		RETVAL=$(countLVM)
    		[ $RETVAL -eq 0 ] && success || failure
    		echo
    		;;
    	*)
    		gprintf "Usage: %s stop\n" "$0"
    		;;
    esac
    else
    {
    	echo "No LVM partition mounted:"
    	mount
    } | sed 's/^/safe_lvm_umount... /'
    fi
    
    exit ${RETVAL:-0}

    First two comments:

    — The strange “12345†runlevel in Default-Start is a probably useless bug work-around I picked from popfile, in hope it would help, but it doesn't change anything. Same for Default-Stop.

    — The whole “else {…} | sed …†block was added to still get something on screen even if no LVM partitions are mounted. I don't need it but I try to debug my problem…

     

    I enabled my script as needed:

    [yves@sedentaire ~]$ find /etc/rc.d -name "*safe-lvm-umount" | xargs ls -1
    /etc/rc.d/init.d/safe-lvm-umount
    /etc/rc.d/rc0.d/K70safe-lvm-umount
    /etc/rc.d/rc1.d/S99safe-lvm-umount
    /etc/rc.d/rc2.d/S99safe-lvm-umount
    /etc/rc.d/rc3.d/S99safe-lvm-umount
    /etc/rc.d/rc4.d/S99safe-lvm-umount
    /etc/rc.d/rc5.d/S99safe-lvm-umount
    /etc/rc.d/rc6.d/K70safe-lvm-umount
    /etc/rc.d/rc7.d/K70safe-lvm-umount

     

    And yet… whatever I do, my script is NEVER called on shutdown! I always get this:

    [EDIT: I removed the screenshot; here's the relevant part:]
    Unmounting file systems: umount2: Device or resource busy
    umount: /ici: device is busy.
           (In some cases useful info about processes that use
            the device is found by lsof(8) or fuser(1))
    umount2: Device or resource busy                              [FAILED]
    [/EDIT]

     

    What should I do to make sure the script is run? The script is good because the PC doesn't hang if I run it before calling shutdown.

     

    Yves.

  4. This “cloud†offering is simply data storage, isn't it?

    As for the “One†cloud, I really wonder if the name was especially chosen to clouden :P the Mandriva One name, sort of override it (as we say in programmation); after all, Mandriva is (IMHO) Ubuntu's most serious concurrent for a general-purpose easy-to-use distribution.

     

    Apart from that, I found interesting to discover the future deprecation of HAL. It seemed new and nice to me (I'm often grateful for the availability of “lshalâ€), and yet, it's soon deprecated… For the better, I hope.

     

    Yves.

  5. I've had repeated problems with a SATA link (for my DVD burner), until I plugged out, and back in, all SATA connectors… Worth checking.

     

    I don't know where the SATA connector comes from, but surely the design work was done by a trainee!

     

    Yves.

  6. No sorry. It seems no desktop can be found… Do you use autologin, or do you use the login screen? In the latter case, in the session-choice menu, what choices do you have (Gnome, IceWM, KDE…)? In the former case, from the terminal window you see, type “mcc&†and once in the control center (on the last tab), disable auto-login.

     

    Yves.

  7. I have used Drakbackup in the past, but I stopped doing that because there was no easy way to recover files. Now they're addressing this issue though, so you could give this good tool a try.

    Draksnapshot is another kind of backup where you have a snapshot of some directories created each hour/day/month… (or something like that). This is the kind of backup I use now, although not Mandriva's tool but rather a script of my own (an old version is posted somewhere here).

     

    Yves.

  8. Meanwhile, if you have access to the command line, you can try and reconfigure Mandriva to disable auto-login, so that you're not systematically dropped into a non-working KDE. To do this, run “startx /usr/bin/mcc"; from there, you'll also be able to install alternate desktop environments.

     

    Yves.

  9. This is something I have never done, but without changing the idea, I would write the above command rather like this:

    dd if=/dev/sda bs=512 count=1 | ssh username@host "dd of=/home/username/Desktop/mbr.img"

     

    Yves.

     

    Ah. Ian was quicker. You'd better follow Ian's advice; at least he knows what he's writing about :D

  10. I've got a quite stable setup now. Unfortunately, I was unable to do anything using ncpfs. Only the official Novell client for Linux seems able to connect to this clustered Novell volume correctly! And I was not able to use this client with Mandriva.

     

    The setup is such:

    — A very minimal trimmed-down opensuse virtual machine in VirtualBox (64MB RAM, 2MB VideoRAM, 3GB HardDisk, NAT, 800x600x32, IceWM).

    — In this opensuse, the display manager is disabled, and IceWM is started directly as the single existing user (“yvesâ€) from the /etc/inittab file, along with ncl_autologin.

    — In the XML file for this virtual machine (~/.VirtualBox/Machines/opensuse/opensuse.xml), inside the XPath “/VirtualBox/Machine/ExtraDataâ€, I added this for redirecting ports from the host to the guest:

          <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/smb/HostPort" value="1445"/>
         <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/smb/GuestPort" value="1445"/>
         <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/smb/Protocol" value="TCP"/>
         <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/smbu/HostPort" value="1445"/>
         <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/smbu/GuestPort" value="1445"/>
         <ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/smbu/Protocol" value="UDP"/>

    — In the opensuse guest, I setup Samba this way:

    [global]
           security = SHARE
           smb ports = 1445
           map to guest = Bad User
           guest account = yves
           log file = /var/log/samba/%m.log
           max log size = 50
           unix extensions = No
           socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
           load printers = No
           local master = No
           dns proxy = No
           wins proxy = No
           wins support = No
           veto files = /.unison/
    
    [novell]
           comment = Novell mounts
           path = /var/opt/novell/nclmnt/yves
           force user = yves
           guest only = Yes
           guest ok = Yes
           case sensitive = Yes
           hide dot files = No
           read only = No
           delete readonly = Yes

    — On the Mandriva host, I use autofs, and this line connects to the virtual machine's Novell share (adapt options to your situation):

    suse_novell  -fstype=cifs,port=1445,uid=500,gid=500,noperm,noacl,nounix,iocharset=utf8  ://localhost/Novell

     

    There only remained to automate things, so :

    — I created the following script, auto-started by Gnome (but I also have an icon on the panel for restarting it in case of problem):

    #!/bin/bash
    
    opensuseFile=~/.VirtualBox/Machines/opensuse/opensuse.xml
    uuid=sed -n '/<Machine/{s/^.*uuid="{\([^"]*\)}".*$/\1/p;Q}' "$opensuseFile"
    
    if /sbin/ifconfig | grep -F adr:160.14. &>/dev/null; then
    if ! pidof VirtualBox &>/dev/null; then
    	VirtualBox &
    	sleep 3s
    fi
    if VBoxManage list runningvms | grep -Fx "$uuid" &>/dev/null; then
    	VBoxManage controlvm opensuse poweroff
    	sleep 2s
    fi
    VBoxManage startvm opensuse
    sleep 3s
    sed -n 's~^.*<ExtraDataItem name="\(VBoxInternal/[^"]*\)" value="\([^"]*\)"/>.*$~\1 \2~p' "$opensuseFile" \
    | while read var val; do
    	VBoxManage setextradata opensuse "$var" "$val"
    done
    sleep 120s
    
    # Enter password on ncl_autologin prompt; don't forget key releases.
    # See: http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html
    VBoxManage controlvm opensuse keyboardputscancode xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
    fi &

    — I created the following script, for which I have a launcher on the panel, to stop the PC:

    #!/bin/bash
    
    sudo /sbin/service autofs stop
    sleep 3s
    
    if pidof VirtualBox &>/dev/null; then
     # Ctrl+Echap
     VBoxManage controlvm opensuse keyboardputscancode 1d 01 81 9d
     sleep 1s
     # Up
     VBoxManage controlvm opensuse keyboardputscancode e0 48 e0 c8
     sleep 1s
     # Right
     VBoxManage controlvm opensuse keyboardputscancode e0 4d e0 cd
     sleep 1s
     # Down, Down, Down
     VBoxManage controlvm opensuse keyboardputscancode e0 50 e0 d0
     VBoxManage controlvm opensuse keyboardputscancode e0 50 e0 d0
     VBoxManage controlvm opensuse keyboardputscancode e0 50 e0 d0
     sleep 1s
     # Enter ("Stop computer" in IceWM)
     VBoxManage controlvm opensuse keyboardputscancode 1c 9c
    
     while [ $(VBoxManage list runningvms 2>/dev/null | tail --lines +5 | wc -l) -gt 0 ]; do sleep 1s; done
     killall VirtualBox
    fi
    halt

    — Which in turn needed that I gave myself the right to stop autofs; this is done in visudo by specifying this line (a more specific right can be written but this was enough for me):

    yves localhost=(root) NOPASSWD: /sbin/service

     

    Maybe this will help someone with a similar need… This is far from perfect, and I wish Novell would stop doing SuSe-only “driversâ€.

     

    Yves.

  11. To get an overall correct result, I did the following change.

    In gdmsetup, under the “Security†tab, there's a button for opening an advanced configuration panel for the X server. In there, for both the Standard and the Chooser servers, I added “ -dpi 96†to the command-line.

     

    Then (as root), “service dm restartâ€, and all is fine :)

     

    Yves.

  12. Yes :)

    On the command-line, as root:

    urpme --auto-orphans

     

    Of if you feel confident about it, still as root, edit the /etc/urpmi/urpmi.cfg, and between the curly brackets at the beginning, add a line with only this content:

    auto-orphans

    I don't know if this will work, but if it does, then it will be automatic each time you use the “Manage software†GUI tool, too.

     

    Yves.

  13. Well… it looks like both you and the person who will edit the pages are rather beginners in computing, or at least where Linux is concerned. Nothing wrong with that (we all were at some point), but I'll therefore try and suggest the most simple solution possible.

     

    I hope the other computer, with Windows and Front Page on it, is on the same network as your server's network. If that is so, the easiest route, in my opinion, provided you trust this person enough, is to give this person direct access to the files through a “windows share†(done with the “Samba†software on linux).

     

    To do that, open the “Configure your computer†program (this is my translation from French so some words may differ), also known as “mccâ€.

     

    You'll need a local Unix user for your co-worker. If that's not already done, go to the “System†section, and select the “Manage users†item. In there, in the “Actions†menu, select “Add userâ€, enter his full name, choose a short and simple user name, an appropriate password, and that's all; click OK, and then “Quit†in the “File†menu.

     

    Now, still in the control center, in the “Network shares†section, select the “Share your disks and folders with Windows systems (Samba)†item.

     

    Under the “Samba users†tab, you'll create a local “Windows†login for your co-worker. Click on the “Add†button, select the user you just created in the list, and enter the same password.

     

    Under the “Files shares†tab, you'll create the share. Click the “Add†button, and in the window, enter “server_html†for the share name, and “/var/www/html†(no spaces) for both the folder and the comment; validate with OK.

    Select the share in the list and click the “Modify†button. In the window, select “yes†for the option “visible on the network†(or “browsableâ€?). Under the advanced user options, enter your co-worker login both as an authorized user and us a user with write permission, and enter “apache†as a “Forced groupâ€. Under the advanced file options, select “yes†for the option “keep characters case†(or “case-sensitiveâ€?). Validate.

     

    In the “File†menu, select “Write configurationâ€, then select “Restart†from the “Samba server†menu. Quit.

     

    Unfortunately, there's one needed option that does not appear in the Mandriva tool. So we'll do this by hand: open a terminal window (usually in the “Tools†menu), and enter “su - root†and the [Enter] key. You'll be asked for the root password; type it and press the [Enter] key again. You'll see the prompt change from your own “…$†to root's “…#â€. Then type “gedit /etc/samba/smb.conf†(if you use Gnome) or “kedit /etc/samba/smb.conf†(if you use KDE), and in the text editor, go to the end of the file. You'll see a line like “force group = apacheâ€; duplicate this line, and change one of them by replacing “group†by “userâ€, so you'll end up with something like this:

        force group = apache
       force user = apache

    Save the file and exit the editor. Now in the terminal window, while still being root, type “service smb restartâ€. You can close everything, you're done. Well, you might also have to allow Samba through your firewall (Security section in MCC).

     

    Your co-worker should be able to attach a network drive to “\\your_server_ip\server_htmlâ€.

     

    Yves.

  14. I have a family VCR tape I value a lot, and I want to convert it to DVD format.

    So far, harnessing all the power I could get from “sedentaire†and my simple PCTV Stereo card, (using mencoder, mpeg2, vqscale=2), I managed to transform the 3hr tape into a single 768×576 video file, tens of GB in size.

     

    I have also selected the mplayer parameters that give IMO the best compromise between detail and image quality (noise removal, color adjustment…). I'm no expert, though, and I may later ask for advice on this topic.

     

    Last but not least, I have written down in a file the exact beginning frame and ending frame of each sequence I want to encode individually.

     

    Now I want to post-process this file to obtain sequences that will all fit on a DVD. I'll author the DVD by creating several menus to launch the sequences in the order I want; I have past experience with simple menu-making, and dvdauthor usage.

     

    Knowing the cumulative length of all sequences, I computed an average video bit-rate (VBR) so that it could all fit on a standard single layer DVD.

    My attempt has been to iterate on the sequences-file (with a script) to post-process each sequence (using -idl and -endpos) by applying the “best†parameters I had found and the VBR I had computed (two-pass). And I was disappointed by the resulting quality.

     

    Having no expertise in audio-video processing, I'm thinking about raising the VBR. To do this, I need to author a dual-layer disk. Is it possible?

     

    Yves.

  15. Did you perhaps overwrite the partition with the ISO file on it, when formatting swap, /, and /home?

    Or maybe Mandriva differs from SuSe by requiring a directory tree for installing from HD, instead of a single ISO file…

     

    Please report on these points. I have no further idea, though… Installing from hard disk is something I've never done.

     

    By the way, what is your “level†with Linux? And do you have a floppy drive?

     

    Yves.

  16. It's a Packard Bell laptop. It used to run Debian 3, and was updated, upgraded, and so on… until late 2008, early 2009 (I don't remember), after a very big upgrade (to Deb.4?), when suddenly all letters on GDM screen were huge. But after login, all was fine, so I did nothing until summer came.

     

    I played a bit with config files, and searched Internet (nothing found…). As I could not find any cure to this problem, I decided to remove Debian, and install Mandriva 2009.1 instead.

    To my great surprise, Mandriva installation screens suffered the same huge letters, but I finally managed to get Mandriva installed (using One IIRC, thus bypassing those screens).

     

    Seeing the problem occured on install screens, I expected the GDM screen to behave the same, and of course it did. So the problem clearly is not related to Debian but rather to the hardware. I suspect the graphics chip is reporting a wrong DPI value, and some sort of auto-configuration takes place using this value, until the desktop is displayed, where Gnome forces a fixed (and approximately good) value of 96dpi.

     

    Can anyone help me set the correct character size on GDM?

     

    Yves.

  17. The editing tool can be freely chosen, be it Front Page or anything better, with no relation to the server setup.

     

    Whatever tool you use to edit the pages, you have to access the files first. There are several common ways to access the server pages' storage location: SSH, FTP, or WebDAV (on HTTP).

     

    Tell us what access protocol you use (or if you did not setup any), and someone should be able to help you. Look also at what protocol the tools you intend to use (eg: Front Page) do understand.

     

    Yves.

×
×
  • Create New...