• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • 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
4.7k
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.
  • S
    sudburr
    last edited by Oct 20, 2019, 5:30 PM

    Primarily I want to as it says, totally remove everything and anything that FOG has touched or used from the latest release 1.5.7 all the way back to at least 1.2.

    Not that I’m giving up on FOG right now, but I have some legacy servers cruising for a bruising, and I want to be able to rebuild as cleanly as possible, by remote.

    Then of course, comes the rebuild. Installing FOG is a cinch, but of course I need to re-install those OS elements affected, and I’d prefer to not have anything at all left from them that FOG may have touched … to totally remove any doubt that something, somewhere, may have been borked by FOG or the many versions installers over the years of revisions.

    I’m interested in a CentOS 7 solution.

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

    W 1 Reply Last reply Oct 20, 2019, 7:32 PM Reply Quote 0
    • W
      Wayne Workman @sudburr
      last edited by Oct 20, 2019, 7:32 PM

      @sudburr Are you aware of this article? https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG

      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
        sudburr
        last edited by Oct 22, 2019, 8:59 PM

        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 Oct 22, 2019, 9:20 PM

          @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
          • S
            sudburr
            last edited by Oct 23, 2019, 5:49 PM

            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 Oct 23, 2019, 9:14 PM

              @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

              S 1 Reply Last reply Oct 24, 2019, 2:42 PM Reply Quote 1
              • T
                Tom Elliott
                last edited by Tom Elliott Oct 23, 2019, 3:58 PM Oct 23, 2019, 9:56 PM

                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

                S 1 Reply Last reply Oct 24, 2019, 2:47 PM Reply Quote 1
                • S
                  sudburr @Sebastian Roth
                  last edited by Oct 24, 2019, 2:42 PM

                  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 ]

                  W 1 Reply Last reply Oct 26, 2019, 2:08 AM Reply Quote 0
                  • S
                    sudburr @Tom Elliott
                    last edited by Oct 24, 2019, 2:47 PM

                    @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 Oct 26, 2019, 2:56 AM Oct 25, 2019, 4:46 PM

                      @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
                      • W
                        Wayne Workman @sudburr
                        last edited by Oct 26, 2019, 2:08 AM

                        @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 Oct 26, 2019, 8:56 AM

                          @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
                          1 / 1
                          • First post
                            8/12
                            Last post

                          243

                          Online

                          12.0k

                          Users

                          17.3k

                          Topics

                          155.2k

                          Posts
                          Copyright © 2012-2024 FOG Project