Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


[TESTING] Minstall: A Framework For Server Management - Page 2
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[TESTING] Minstall: A Framework For Server Management

2»

Comments

  • @marrco said: i'm studying and willing to test as soon as i have time to reinstall a vps. Did you consider adding debian-backports to default apt/sources.list ?

    I won't add it as a default but will certainly consider making it an option ;)

    Thanked by 1marrco
  • Fixed more bugs, namely permissions bugs and the php5-mysql installation code :P
    I tested it on my server and it all seems in good working order (yea, not the first time I've said that!)

  • tsctsc Member
    edited January 2012

    @maxexcloo said: If you want to disable InnoDB just run the http-configure-mysql module after installing MySQL, it does it :P

    Well, the problem was that if you had a low-memory VPS, MySQLd would not start because InnoDB didn't have enough memory, and that would cause a whole flurry of problems. That code fixed the problem by disabling the start of MySQLd during dpkg configuration.

    However, you seem to have fixed it by adding in the files directly before installation even starts, which does work. However, that renders http-configure-mysql partially useless because the configuration is already there and the script doesn't delete it if you didn't want low memory usage and/or InnoDB disabled.

    (If you don't mind a suggestion, I'd suggest having an option to disable the start of MySQLd and go straight to http-configure-mysql before the section where the script does its own restart.)

  • @tsc said: However, you seem to have fixed it by adding in the files directly before installation even starts, which does work. However, that renders http-configure-mysql partially useless because the configuration is already there and the script doesn't delete it if you didn't want low memory usage and/or InnoDB disabled.

    Running http-configure-mysql and selecting no at relevent prompts will actually remove the offending configuration files and restore innodb/normal memory settings :)

    @tsc said: (If you don't mind a suggestion, I'd suggest having an option to disable the start of MySQLd and go straight to http-configure-mysql before the section where the script does its own restart.)

    Sure, I was just unsure of how to do this, mind sharing any ideas/tips you have?

  • tsctsc Member
    edited January 2012

    @maxexcloo said: @tsc said: However, you seem to have fixed it by adding in the files directly before installation even starts, which does work. However, that renders http-configure-mysql partially useless because the configuration is already there and the script doesn't delete it if you didn't want low memory usage and/or InnoDB disabled.

    Running http-configure-mysql and selecting no at relevent prompts will actually remove the offending configuration files and restore innodb/normal memory settings :)

    Oh! I didn't see the rm in the else, sorry.

    But if you wanted to do that, here's what I think would work:

    #!/bin/bash
    # HTTP Install: MySQL Database Server
    
    # Common Functions
    source $MODULEPATH/http-install-common.sh
    
    # Package List Update Question
    package_update_question
    
    # Configure After Install Question
    if question --default yes "Do you want to configure MySQL before starting the server? (Y/n)"; then
        CONFIGURE=1
    else
        CONFIGURE=0
    fi
    
    # Disable Start After Installation
    if [ $CONFIGURE -eq 1 ]; then
        subheader "Disabling Server Start..."
        cat > /usr/sbin/policy-rc.d <<EOF
    #!/bin/sh
    exit 101
    EOF
        chmod +x /usr/sbin/policy-rc.d
    fi
    
    # Install Package
    subheader "Installing Package..."
    package_install mysql-server
    
    # Check PHP
    if check_package "php5-fpm"; then
        subheader "Installing PHP MySQL Package..."
        package_install php5-mysql
    fi
    
    # Configure After Install
    if [ $CONFIGURE -eq 1 ]; then
        subheader "Starting Configuration..."
        rm /usr/sbin/policy-rc.d
        ./$MODULEPATH/http-configure-mysql.sh
    fi
    
    # Stop Daemon
    subheader "Stopping Daemon..."
    daemon_manage mysql stop
    
    # Copy Configuration
    subheader "Copying Configuration..."
    cp -r $MODULEPATH/$MODULE/* /etc/
    
    # Start Daemon
    subheader "Starting Daemon..."
    daemon_manage mysql start
    
    # Package List Clean Question
    package_clean_question
    

    Full credits to TigersWay for his elegant solution.

    You'll probably have to check my if statements, since I'm not a shell coder, but I think they're right. :) I assume a similar procedure for nginx if you wanted to do it there too.

Sign In or Register to comment.