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

Linux Imaging and Fog Client

Scheduled Pinned Locked Moved Solved
Linux Problems
4
4
691
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.
  • J
    jhumpf
    last edited by Feb 10, 2020, 8:37 PM

    Is there anyone out there who has had success with the FOG client on Linux?
    And had a very easy and comprehensive way to deploy Linux images and rename them/Join them to the domain post deployment?
    Please share working scripts if you have them.

    S 1 Reply Last reply Feb 11, 2020, 9:33 AM Reply Quote 0
    • S
      shruggy @jhumpf
      last edited by shruggy Feb 11, 2020, 6:48 AM Feb 11, 2020, 9:33 AM

      @jhumpf I don’t use the FOG client on Linux, but these are my scripts for CentOS 6:
      /etc/rc.d/rc.local:

      #!/bin/sh
      #
      # This script will be executed *after* all the other init scripts.
      # You can put your own initialization stuff in here if you don't
      # want to do the full Sys V style init stuff.
      
      touch /var/lock/subsys/local
      . root/ckhostname
      exit 0
      

      /root/ckhostname:

      #!/bin/sh
      network=/etc/sysconfig/network
      ipaddr=$(hostname -I)
      shostname=$(hostname)
      rhostname="$(dig +noall +answer +short -x $ipaddr)"
      rhostname=${rhostname%.}
      if [ "$rhostname" != "$shostname" ]; then
        sed -i "/^HOSTNAME=/s/=.*/=$rhostname/" "$network"
        hostname $rhostname
      fi
      

      I plan to retire them as I’m migrating the hosts to CentOS 8.

      hostname -I may not give you what you want depending on how your system is configured, instead you can try something like ip -4 -br addr|awk -F'[ /]+' '/UP/,$0=$3' or, more cautiously worded:

      ip -4 -br addr | awk '$2=="UP" {sub(/\/.*/,"",$3); print $3}'
      
      1 Reply Last reply Reply Quote 0
      • J
        jvilks
        last edited by jvilks Feb 17, 2020, 10:01 AM Feb 17, 2020, 3:22 PM

        Indeed, I am currently working on unattended Ubuntu Server 18.04 installation:

        1. deploying ubuntu server;
        2. updating hostname which is fetched from a local web service;
        3. changing password for a fixed user which is also fetched from a local web service;
        4. running installation script (apt-get install; pip install; and adjusting some unique per host configurations)

        I am able to deploy ubuntu server, contact the local web service to generate hostnames and passwords using postdownload scripts, yet I am not able to change the password and the hostname, nor I am not able to do some final installations.

        I assume that it is done by specifying the snapins, yet my /bin/bash snapin is queued, but not executed.

        I’ve created a simple snapin

        #!/bin/bash
        
        echo "Snapin BLAH BLAH beginning installation" > %systemdrive%\fog_snapin_install_snapinname.log
        echo "test" > /home/user/test.txt
        echo "Snapin BLAH BLAH ending installation" > %systemdrive%\fog_snapin_install_snapinname.log
        

        I believe by being able to finish my small project I would be able to showcase something also for Linux users.

        EDIT: of course I have just noticed that in order to use snapins one must install fog client on the host machine.

        So my question would rather be “How do you run a script after the first boot using the deployed host OS without installing FOG Client?”

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by Feb 17, 2020, 9:10 PM

          @jhumpf Have you tried the scripts? Can we mark this closed or do you need any further help with this?

          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
            2/4
            Last post

          229

          Online

          12.1k

          Users

          17.3k

          Topics

          155.4k

          Posts
          Copyright © 2012-2024 FOG Project