Want more timely Centmin Mod News Updates?
Become a Member

Beta Branch Confused on options wording in centmin.sh

Discussion in 'Beta release code' started by jeffwidman, May 10, 2015.

  1. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    9:43 AM
    I'm editing which services get installed by default--for example, I want to disable PUREFTPD and NSD DNS installation/running.

    When I check the code, I see:
    Code:
    # Disable installed services by default
    # The service is still installed but disabled by default
    # can be re-enabled with commands
    # service servicename start; chkconfig servicename on
    NSD_DISABLED=n               # NSD disabled by default with chkconfig off
    MEMCACHED_DISABLED=n          # Memcached server disabled by default via chkconfig off
    PHP_DISABLED=n                # PHP-FPM disabled by default with chkconfig off
    MYSQLSERVICE_DISABLED=n       # MariaDB MySQL service disabled by default with chkconfig off
    PUREFTPD_DISABLED=n           # Pure-ftpd service disabled by default with chkconfig off
    I'm a bit confused here--the comments say all these services are disabled by default, but the way the code reads it seems to say "Disable this? No, don't disable it". Also, I know when I installed Centminmod with default settings, I know NSD and the rest of these services were running--I noticed NSD running in `top` which is why I started digging into how to disable.

    1) Are these services currently all not disabled by default?

    2) If so, maybe the comments could be changed to reflect that?

    3) If I disable NSD install using `NSD_INSTALL=n`, do I also need to change the `NSD_DISABLED` variable to `y`?

    4) I never use FTP and won't be giving anyone else FTP access either. Is there a way to disable the installation of PureFTPD? I see the `PUREFTPD_DISABLED` variable, but couldn't find an equivalent `PUREFTPD_INSTALL` variable like NSD has...
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    2:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    they're only disabled by default if set to ='y'

    guess i need to re-word that to something like
    Code:
    # When set to =y, will disable those listed installed services by default
    # The service is still installed but disabled by default and can be 
    # re-enabled with commands:
    # service servicename start; chkconfig servicename on
    NSD_DISABLED=n                # when set to =y, NSD disabled by default with chkconfig off
    MEMCACHED_DISABLED=n          # when set to =y,  Memcached server disabled by default via chkconfig off
    PHP_DISABLED=n                # when set to =y,  PHP-FPM disabled by default with chkconfig off
    MYSQLSERVICE_DISABLED=n       # when set to =y,  MariaDB MySQL service disabled by default with chkconfig off
    PUREFTPD_DISABLED=n           # when set to =y, Pure-ftpd service disabled by default with chkconfig off
     
    • Like Like x 1
  3. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    2:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    fixed in commit done just now update centmin.sh comments · centminmod/centminmod@34664c9 · GitHub

    3). if you disable NSD_INSTALL=n, then no need for NSD_DISABLED=y, however by default generally don't advise it as some software only have install routines at install time and not later, so if further down the track you change you mind and want to install it, you won't be able to (same reason why PUREFTPD doesn't have a do not install variable). Hence, the above _DISABLED variables, to allow initial install, but disable and turn those off after install. So if you need them in future, it's just a matter of service start command and chkconfig service on.
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    2:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    Also if you are doing custom settings for centmin.sh, also check out custom_config.inc file support added to .08 beta 02 CentOS 7.x - How to help test .08 CentOS 7 Betas with Github code ? | Page 22 | Centmin Mod Community

    Just create file /etc/centminmod/custom_config.inc and dump all your custom centmin.sh variables into it. They will override centmin.sh set defaults :D

    i.e. to reproduce your forked repo defaults in /etc/centminmod/custom_config.inc place

    Code:
    NGINX_IPV='y' #NGINX IPV6 compile support for unattended mode only
    USEEDITOR='vim' # choice between nano or vim text editors for cmd shortcuts
    NSD_DISABLED=y                # when set to =y, NSD disabled by default with chkconfig off
    PUREFTPD_DISABLED=y           # when set to =y, Pure-ftpd service disabled by default with chkconfig off
    
     
  5. RoldanLT

    RoldanLT Well-Known Member

    3,899
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    12:43 AM
    1.11
    10.2
    And the comments are not necessary right?
    Only the valid variable and value? :)
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    2:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    yeah comments not necessary :)
     
  7. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    9:43 AM
    Thanks!

    Understood, and agree in principle. But I don't plan on ever running my own DNS server--it's faster for end users to run it on Cloudflare, plus a lot more resilient and faster to update if I ever switch hosts. And if I ever change my mind, I can stand up a new centminmod server in about an hour by running my Ansible scripts that wrap around centminmod and customize everything the way I need it.

    Holy smokes--totally missed that. That's AWESOME!!! Definitely will be using that going forward instead of a custom fork.
     
  8. jeffwidman

    jeffwidman Active Member

    152
    27
    28
    Dec 3, 2014
    Ratings:
    +51
    Local Time:
    9:43 AM
    Oh, and this did seem a good opportunity to point out if the shell script got moved to ansible this wouldn't be an issue. People just comment/uncomment what they want installed and then rerun the Ansible playbook, and if it's not there it would be installed/removed. That's the whole idempotence idea.

    I've been playing with it quite a bit, and it's really easy for non-tech users to use since it's all YAML and no programming unless you dive into the guts... just have a single config file that they edit to pick which programs/versions of nginx/php/mariadb they want.

    I know you're pretty happy with the bash script, but if you ever want to explore this, I'd be happy to help you convert everything... It'd also make it more modular so it was easier to add/remove other 'plays' other people have created, like New-relic or Tarsnap installation...
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    2:43 AM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah unfortunately don't have the spare time to move that far away from how Centmin Mod is currently developed. But if you want to share your Ansible method, it could rub off on me eventually :) YAML still confuses me, h2o HTTP/2 web server uses it YAML for it's vhost config file and it does my head in when YAML file get's larger and more complicated heh.

    yeah thought it would be right up your alley :D