• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to totally expunge FOG and everything it's touched

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    4
    12
    5.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sudburrS
      sudburr
      last edited by

      You misunderstand. I’m exploring a “nuke it from orbit” solution. I want to tear the server down to its bones then build it back without physical intervention.

      For one particular server I used the following.

      # Remove FOG services
      	rm /etc/init.d/FOGImageReplicator
      	rm /etc/init.d/FOGMulticastManager
      	rm /etc/init.d/FOGScheduler
      
      # Delete FOG database
      	mysql -u root -p
      	<password>
      	drop database fog;
      	exit
      
      # Remove FOG files
      	rm -rf /var/www/fog
      	rm -rf /var/www/html/fog 
      	rm -rf /opt/fog
      	rm -rf /opt/fog.old
      	rm -rf /tftpboot
      	rm -rf /opt/trunkgit
      	rm -rf /opt/trunksvn
      
      # Delete FOG system user
      	userdel fog
      	userdel fogproject
      
      # Delete supportive systems
      	yum -y remove php*
      	yum -y remove httpd
      
      # Clean & Update the OS
      	yum clean all
      	rm -rf /var/tmp/yum-administrator-PudGB
      	rm -rf /var/cache/yum
      	yum list iostat
      	yum makecache
      	yum grouplist
      	yum grouplist hidden
      	yum update -y
      
      # Reboot to Commit
      	reboot
      
      

      [ Standing in between extinction in the cold and explosive radiating growth ]

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @sudburr Why not re-install the whole system from scratch?

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 4
        • sudburrS
          sudburr
          last edited by

          Re-installing FOG does not strip it from the server. It re-installs FOG.

          It’s easy enough to yum remove virtually everything else. What about a solution for FOG and its tendrils?

          [ Standing in between extinction in the cold and explosive radiating growth ]

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @sudburr What I meant is re-installing the Linux OS!

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            sudburrS 1 Reply Last reply Reply Quote 1
            • Tom ElliottT
              Tom Elliott
              last edited by Tom Elliott

              The other method is to use most of the stuff but for removing packages, source in the .fogsettings file before you remove the /opt/fog/ folder. Then you can use packagemanager-uninstallcmd $packages

              Note this will simply remove the packages fog installs. All the other bits of service removal and what not should work as indicated.

              I kind of side with @Sebastian-Roth however because removing all the installed packages can sometimes uninstall elements unexpectedly and out of “fogs” control. I’ve seen occasionally some like like installing python then uninstalling it breaking package manager tools like yum or apt

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              sudburrS 1 Reply Last reply Reply Quote 1
              • sudburrS
                sudburr @Sebastian Roth
                last edited by

                But I don’t want to re-install the OS by remote. Not yet at least.

                [ Standing in between extinction in the cold and explosive radiating growth ]

                Wayne WorkmanW 1 Reply Last reply Reply Quote 0
                • sudburrS
                  sudburr @Tom Elliott
                  last edited by

                  @Tom-Elliott Okay, I’ll look into that.

                  Ultimately I’m looking for a best-effort recommended, second to last resort (reinstalling OS would be the last resort) solution that would tear down and pave over all that is FOG.

                  Sometimes tinkering, tweaking and forensic fixes just don’t do the job and you need other more drastic options in your troubleshooting arsenal; a FOG uninstaller.

                  [ Standing in between extinction in the cold and explosive radiating growth ]

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sebastian Roth Moderator
                    last edited by Sebastian Roth

                    @sudburr I can see that re-installing the OS in your situation is not easy if you with the server being remote. Before I get into the details, here is one word of caution: Be aware that purging the CA and certificate/key files will likely cause you a lot of trouble if you have clients that are pinned to this FOG server!! Make a backup of those files before you go ahead. As well this script will purge ALL IMAGES from the server.

                    I won’t be responsible for any trouble caused by this script!

                    I see four options:

                    1. you have a proper server with iKVM - this way you can boot the server from a virtually mount ISO and install from scratch
                    2. someone is at site to setup a iKVM box for you - similar to 1. but you’d need the box and someone setting it up at site
                    3. someone is at site and can boot from DVD for you and type in grub boot parameters for VNC setup: https://cloudwrk.com/remote-server-installation-centos-7/
                    4. Someone implements the ./installfog.sh --uninstall option that was added as “Not yet supported” years ago but unfortunately was never finished

                    Don’t feel offended, I am just joking with some of what I said. Still re-installing the OS is the best option to have a clean start.

                    Other than that I might add some commands to your script:

                    source /opt/fog/.fogsettings
                    
                    # Remove FOG services
                    for service in FOGMulticastManager.service FOGImageReplicator.service FOGScheduler.service FOGSnapinReplicator.service FOGSnapinHash.service FOGPingHosts.service FOGImageSize.service
                    do
                        systemctl stop $service
                        systemctl disable $service
                        rm -f /usr/lib/systemd/system/$service
                    done
                    
                    # Delete FOG database
                    mysql -u root -p<password> -e 'DROP DATABASE fog;'
                    
                    # Remove FOG files
                    rm -rf /images
                    rm -rf /var/www/fog
                    rm -rf /var/www/html/fog 
                    rm -rf /opt/fog
                    rm -rf /opt/fog.old
                    rm -rf /tftpboot
                    rm -rf /tftpboot.prev
                    rm -rf /opt/trunkgit
                    rm -rf /opt/trunksvn
                    
                    # Remove configs generated by the installer
                    rm -rf /etc/dhcp/dhcpd.conf /etc/exports /etc/httpd/conf.d/fog.conf /etc/xinetd.d/tftp* /etc/vsftpd /etc/php-fpm.d/www.conf /etc/php.ini
                    
                    # Remove service data
                    rm -rf /var/lib/dhcpd /var/lib/mysql /var/lib/rpcbind /var/lib/nfs /var/lib/php
                    
                    # Remove logs
                    rm -rf /var/log/httpd /var/log/mariadb /var/log/php-fpm /var/log/xferlog /var/log/fog
                    
                    # Delete FOG system user
                    userdel --force --remove fog
                    userdel --force --remove fogproject
                    rm -rf /home/fog*
                    rm -rf /home/fogproject*
                    
                    # Delete packages installed by FOG installer sourced from .fogsettings
                    uninstall=${packages//curl }
                    uninstall=${uninstall//gzip }
                    uninstall=${uninstall//tar }
                    yum -y remove $uninstall
                    
                    # Remove extra repos
                    rm -f /etc/yum.repos.d/epel*
                    rm -f /etc/yum.repos.d/remi*
                    
                    # Clean & Update the OS
                    yum clean all
                    rm -rf /var/tmp/yum-administrator-PudGB
                    rm -rf /var/cache/yum
                    yum list iostat
                    yum makecache
                    yum grouplist
                    yum grouplist hidden
                    yum update -y
                    
                    # Reboot to Commit
                    reboot
                    

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    1 Reply Last reply Reply Quote 0
                    • Wayne WorkmanW
                      Wayne Workman @sudburr
                      last edited by

                      @sudburr said in How to totally expunge FOG and everything it's touched:

                      But I don’t want to re-install the OS by remote. Not yet at least.

                      I’d have already done it…

                      Side note: I rarely even install OSs at home anymore. I have clean VMs that I clone for making new VMs. 😄

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                      Daily Clean Installation Results:
                      https://fogtesting.fogproject.us/
                      FOG Reporting:
                      https://fog-external-reporting-results.fogproject.us/

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sebastian Roth Moderator
                        last edited by

                        @sudburr Ok, I tested and updated my version of the script below (derived from yours).

                        Again, make sure you have backups of your /images and the certificate files before you run this script!! I won’t be responsible for any trouble caused by this script!

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post

                        119

                        Online

                        12.2k

                        Users

                        17.4k

                        Topics

                        155.5k

                        Posts
                        Copyright © 2012-2024 FOG Project