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

langage de programmation

Scheduled Pinned Locked Moved
General
3
51
9.2k
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
    julio
    last edited by Jan 27, 2021, 12:17 PM

    Bonjour, j’aimerais savoir en quelle langage de programmation fog à été développer.

    G 1 Reply Last reply Jan 27, 2021, 12:34 PM Reply Quote 0
    • G
      george1421 Moderator @julio
      last edited by Jan 27, 2021, 12:34 PM

      @julio The web ui is programmed in PHP.

      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!

      1 Reply Last reply Reply Quote 0
      • J
        julio
        last edited by Jan 28, 2021, 11:34 AM

        Bonjour george, désolé de revenir sur cette question.
        je déploie des sytèmes d’exploitation linux ubuntu desktop et debian desktop. c’est pour une ecole et j’aimerai une fois la machine déployer quelle rejoigne un server ldap pour l’authentification des utilisateurs. etant donnée que rejoindre un domaine n’est pas facile, es ce possible de gerer avec un openldap. si quelqu’un peut m’orienté je serais très ravie. merci à vous.

        G 1 Reply Last reply Jan 28, 2021, 12:42 PM Reply Quote 0
        • G
          george1421 Moderator @julio
          last edited by Jan 28, 2021, 12:42 PM

          @julio Forgive me since my French is not 100%, but what I read is you want to deploy a target computer that is either debian or ubuntu. You want to connect to an LDAP service to allow users to log onto the linux computers with a single password. You say that windows AD is to complicated.

          I think since you have windows AD already setup that is the best choice for you instead of setting up openldap and have a second authentication database. You say that connecting to AD is a problem. What stops you from connecting to AD? Is there a technical reason? Or just too many steps to connect to AD?

          What I think could happen is that you deploy a linux computer to a target computer, then run a FOG snapin that connects the target computer to windows AD using a script. I did a quick google search and I do find examples of scripts that do what you want. https://github.com/Makubo/linux-ad-join is one example.

          If you setup openldap, you will still need to script the target computer so that it connects to your openldap server. So the amount of work is the same. If the people that will use these linux computers also use microsoft windows, then windows AD is the best choice.

          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!

          J 1 Reply Last reply Jan 28, 2021, 6:13 PM Reply Quote 0
          • J
            julio @george1421
            last edited by Jan 28, 2021, 6:13 PM

            @george1421 merci beaucoup george. je vais me mettre au travail et si j’ai du mal je reviendrais vers toi.
            si c’est possible. si tu as encore d’autre lien à me proposer je l’accepte volontier.

            G 1 Reply Last reply Jan 28, 2021, 6:29 PM Reply Quote 0
            • G
              george1421 Moderator @julio
              last edited by Jan 28, 2021, 6:29 PM

              @julio There are a few more but if you google for “”

              https://github.com/PierreGode/Linux-Active-Directory-join-script/blob/master/ADconnection.sh

              Details on connecting with command line (you make the bash script then)
              https://www.redhat.com/sysadmin/linux-active-directory

              The idea is when you build your golden/master image you have all of the drivers and software install needed to connect with AD.

              Then you can create a script that runs the first time the linux computer boots after fog imaging. That script will connect the computer to AD. Once the script runs once then it will turn off and never run again. In MS Windows it has that feature in a batch script called setupcomplete.cmd. When windows is finished setting itself up and before it displays the login screen it runs that batch script to complete the windows setup with administrator defined tasks. You just need to duplicate that function with linux.

              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!

              J 1 Reply Last reply Jan 30, 2021, 12:04 AM Reply Quote 0
              • J
                julio @george1421
                last edited by Jan 30, 2021, 12:04 AM

                @george1421 bonsoir george, vraiment je te dois une fiere chandel. pour le moment je travail sur l’installation de mes applications vscode, putty, dobe reader etc. je vais le faire avec ansible. apres cette etape, je travaillerais sur l’AD. merci beaucoup pour ton aide. je te tiendrais au courant si j’ai reussi à joindre mon domaine. et en passant j’utilise windows serveur 2016 et un ubuntu serveur 18.04. je travail sur virtualbox. et en passant je cherche comment avoir directement internet sur mes VM clientes après le déploiement.

                G 1 Reply Last reply Jan 30, 2021, 12:25 AM Reply Quote 0
                • G
                  george1421 Moderator @julio
                  last edited by Jan 30, 2021, 12:25 AM

                  @julio said in langage de programmation:

                  et en passant je cherche comment avoir directement internet sur mes VM clientes après le déploiement.

                  Not sure I understand. If you are using virtual box and you have a bridged network interface configured, your clients should be given an IP address of your LAN network. With that LAN IP address from your dhcp server your vm client computers should have internet access. If you are using NAT or host only then no internet .

                  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!

                  J 1 Reply Last reply Feb 2, 2021, 7:05 AM Reply Quote 0
                  • J
                    julio @george1421
                    last edited by Feb 2, 2021, 7:05 AM

                    @george1421 Bonjour george. merci pour tout, j’ai réussi a insérer internet sur mes machines après le déploiement. je suis entrain de faire des scripts pour renommer mes postes clients ubuntu et débian. j’ai fais un script mais cela ne fonctionne pas. peut tu m’aidée à jetté un coup d’oeil merci bien.

                    cd /images/postdownloadscripts
                    nano renamehost.sh
                    #!/bin/bash
                    ##détection de l’OS, 50 pour les Linux
                    if [[ “$osid” == “50” ]];then
                    ##création d’un répertoire temporaire
                    mkdir /ext
                    ##montage temporaire de la partition système du Linux
                    mount /dev/sda1 /ext

                    ##changement du nom host de la machine définie dans l’interface web
                    echo $hostname > /ext/etc/hostname

                    ##Démontage de la partition système
                    umount /ext

                    ##Suppression du répertoire temporaire
                    rmdir /ext
                    fi

                    Rendre exécutable le script :
                    chmod +x renamehost.sh

                    Modifier le fichier fog.postdownload pour prendre en compte l’exécution du script en post déploiement :
                    nano fog.postdownload
                    .${postdownpath}renamehost.sh

                    1 Reply Last reply Reply Quote 0
                    • J
                      julio
                      last edited by Feb 2, 2021, 7:35 AM

                      voici plus claire mon fichier en question pour renommer le nom de ma VM ubuntu.renomer2.PNG renomer.PNG

                      G 1 Reply Last reply Feb 2, 2021, 12:37 PM Reply Quote 0
                      • S
                        Sebastian Roth Moderator
                        last edited by Feb 2, 2021, 12:00 PM

                        @julio When you say it’s not working, does that mean you see an error somewhere or it just doesn’t seem to change the hostname?

                        I would start by booting up Ubuntu after the deploy and check what you see in /etc/hostname. Is it the correct hostname that means the script did execute correctly but it might not be enough of a change for Ubuntu to accept this new hostname. If it’s not changed than you should start looking at the script again and add more statements for debugging, e.g.

                        #!/bin/bash
                        echo "Hello, this is my postdownload script, press ENTER to proceed"
                        read
                        ##détection de l’OS, 50 pour les Linux
                        if [[ “$osid” == “50” ]];then
                        echo "OK, osid is 50/Linux"
                        ...
                        

                        nano fog.postdownload
                        .${postdownpath}renamehost.sh

                        Be careful here. You need to have a space between the dot and the dollar character for this to work!!

                        . ${postdownpath}renamehost.sh
                        

                        One important thing is that the script needs to have the right line endings. So if you created that script using Windows notepad it will not work. Seems like you used nano but I just want to make sure!

                        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

                        J 1 Reply Last reply Feb 2, 2021, 12:26 PM Reply Quote 0
                        • J
                          julio @Sebastian Roth
                          last edited by Feb 2, 2021, 12:26 PM

                          @sebastian-roth Bonjour roth. oui j’ai utliser nano. mais le nom de ma machine n’a pas changer. ci join mes fichiers.hostname.PNG fichier2.PNG fichie1.PNG

                          1 Reply Last reply Reply Quote 0
                          • S
                            Sebastian Roth Moderator
                            last edited by Feb 2, 2021, 12:31 PM

                            @julio Looking at the script again I see an issue with the mount command. Should be mount /dev/sda1 /ext (space in between!)

                            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

                            G J 3 Replies Last reply Feb 2, 2021, 12:37 PM Reply Quote 1
                            • G
                              george1421 Moderator @julio
                              last edited by Feb 2, 2021, 12:37 PM

                              @julio OK explaining this may be a little hard because of the language differences but lets try.

                              I have examples of postdownload scripts for Windows. The concept is very similar for linux. The logic and flow have already been thought out you just need to translate for linux. You are doing a few steps wrong. I will follow on in the next post after I explain my thought here

                              https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed

                              If you have windows computers and want to install hardware specific drivers then you need all of the scripts in that post. If you only have linux computers then the only base script you need is fog.custominstall

                              The beginning script looks like this

                              #!/bin/bash
                              . /usr/share/fog/lib/funcs.sh
                              [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
                              case $osid in
                                  5|6|7|9)
                                      clear
                                      [[ ! -d /ntfs ]] && mkdir -p /ntfs
                                      getHardDisk
                                      if [[ -z $hd ]]; then
                                          handleError "Could not find hdd to use"
                                      fi
                                      getPartitions $hd
                                      for part in $parts; do
                                          umount /ntfs >/dev/null 2>&1
                                          fsTypeSetting "$part"
                                          case $fstype in
                                              ntfs)
                                                  dots "Testing partition $part"
                                                  ntfs-3g -o force,rw $part /ntfs
                                                  ntfsstatus="$?"
                                                  if [[ ! $ntfsstatus -eq 0 ]]; then
                                                      echo "Skipped"
                                                      continue
                                                  fi
                                                  if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                                                      echo "Not found"
                                                      umount /ntfs >/dev/null 2>&1
                                                      continue
                                                  fi
                                                  echo "Success"
                                                  break
                                                  ;;
                                              *)
                                                  echo " * Partition $part not NTFS filesystem"
                                                  ;;
                                          esac
                                      done
                                      if [[ ! $ntfsstatus -eq 0 ]]; then
                                          echo "Failed"
                                          debugPause
                                          handleError "Failed to mount $part ($0)\n    Args: $*"
                                      fi
                                      echo "Done"
                                      debugPause
                                      . ${postdownpath}fog.copydrivers
                                      # . ${postdownpath}fog.updateunattend
                                      umount /ntfs
                                      ;;
                                  *)
                                      echo "Non-Windows Deployment"
                                      debugPause
                                      return
                                      ;;
                              esac
                              

                              If you can read program code you can see it checks to see if $osid is a ms windows type. The it uses some fog built in function to get the hard drive name, then get the partitions on the hard drive. It loops through the partitions checking to see if there is a directory called windows on that partition. We are using that to find the C drive on windows computer. Once we find the windows directory then we call the copy drivers script. At the end then we unmount the /ntfs directory and exit

                              In your case you can use the same logic but for $osid of 50. Then loop through the partitions looking for the /etc directory on the mounted share of /ntfs. The programming flow for windows is very close to the programming flow I can see for linux.

                              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!

                              J 1 Reply Last reply Feb 2, 2021, 12:51 PM Reply Quote 0
                              • G
                                george1421 Moderator @Sebastian Roth
                                last edited by Feb 2, 2021, 12:37 PM

                                @sebastian-roth said in langage de programmation:

                                Should be mount /dev/sda1 /ext (space in between!)

                                Yes I saw that too.

                                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!

                                1 Reply Last reply Reply Quote 0
                                • J
                                  julio @george1421
                                  last edited by Feb 2, 2021, 12:51 PM

                                  @george1421 salut george, oui j’utilise uniquement des ordinateurs linux et je voulais savoir j’utlise le script que tu viens de m’envoyer et comment je pourrais modifier cela à mon besion.

                                  par exemple je vois partition ntfs cà c’est windows pour linux je remplace avec ext4 ou ext. et le osid 50 mais là je vois osid in 5/6/9 etc.

                                  G 1 Reply Last reply Feb 2, 2021, 1:10 PM Reply Quote 0
                                  • G
                                    george1421 Moderator @julio
                                    last edited by george1421 Feb 2, 2021, 7:11 AM Feb 2, 2021, 1:10 PM

                                    @julio I was thinking something like this:

                                    #!/bin/bash
                                    . /usr/share/fog/lib/funcs.sh
                                    [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
                                    case $osid in
                                        5|6|7|9)
                                            clear
                                            [[ ! -d /ntfs ]] && mkdir -p /ntfs
                                            getHardDisk
                                            if [[ -z $hd ]]; then
                                                handleError "Could not find hdd to use"
                                            fi
                                            getPartitions $hd
                                            for part in $parts; do
                                                umount /ntfs >/dev/null 2>&1
                                                fsTypeSetting "$part"
                                                case $fstype in
                                                    ntfs)
                                                        dots "Testing partition $part"
                                                        ntfs-3g -o force,rw $part /ntfs
                                                        ntfsstatus="$?"
                                                        if [[ ! $ntfsstatus -eq 0 ]]; then
                                                            echo "Skipped"
                                                            continue
                                                        fi
                                                        if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                                                            echo "Not found"
                                                            umount /ntfs >/dev/null 2>&1
                                                            continue
                                                        fi
                                                        echo "Success"
                                                        break
                                                        ;;
                                                    *)
                                                        echo " * Partition $part not NTFS filesystem"
                                                        ;;
                                                esac
                                            done
                                            if [[ ! $ntfsstatus -eq 0 ]]; then
                                                echo "Failed"
                                                debugPause
                                                handleError "Failed to mount $part ($0)\n    Args: $*"
                                            fi
                                            echo "Done"
                                            debugPause
                                            . ${postdownpath}fog.copydrivers
                                            # . ${postdownpath}fog.updateunattend
                                            umount /ntfs
                                            ;;
                                       50)
                                            clear
                                            [[ ! -d /ntfs ]] && mkdir -p /ntfs
                                            getHardDisk
                                            if [[ -z $hd ]]; then
                                                handleError "Could not find hdd to use"
                                            fi
                                            getPartitions $hd
                                            for part in $parts; do
                                                umount /ntfs >/dev/null 2>&1
                                                fsTypeSetting "$part"
                                                case $fstype in
                                                    ntfs)
                                                        dots "Testing partition $part"
                                                        ntfs-3g -o force,rw $part /ntfs
                                                        ntfsstatus="$?"
                                                        if [[ ! $ntfsstatus -eq 0 ]]; then
                                                            echo "Skipped"
                                                            continue
                                                        fi
                                                        if [[ ! -d /ntfs/etc ]]; then
                                                            echo "Not found"
                                                            umount /ntfs >/dev/null 2>&1
                                                            continue
                                                        fi
                                                        echo "Success"
                                                        break
                                                        ;;
                                                    *)
                                                        echo " * Partition $part not linux root filesystem"
                                                        ;;
                                                esac
                                            done
                                            if [[ ! $ntfsstatus -eq 0 ]]; then
                                                echo "Failed"
                                                debugPause
                                                handleError "Failed to mount $part ($0)\n    Args: $*"
                                            fi
                                            echo "Done"
                                            debugPause
                                            # at this point the root file system will be mounted on /ntfs
                                            . ${postdownpath}fog.renamehost.sh
                                            umount /ntfs
                                            ;;
                                        *)
                                            echo "Unknown OS Deployment"
                                            debugPause
                                            return
                                            ;;
                                    esac
                                    

                                    Understand I did not test this code at all. This code may be more complex than you need if only you set the hostname. The script you have will work if you fix what Sebastian posted about your mount command. I just wanted to show you that you can make the core more responsive if your root partition is not always /dev/sda1. In some cases like UEFI disk format /dev/sda1 is the UEFI boot partition and not the OS root partition. Your code would fail if that was the case. Or if your hard drive is a NVMe type then /dev/sda (points to sata) would be wrong and the script would fail because nvme disk have a different partition structure.

                                    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!

                                    J 2 Replies Last reply Feb 2, 2021, 1:31 PM Reply Quote 0
                                    • J
                                      julio @Sebastian Roth
                                      last edited by Feb 2, 2021, 1:24 PM

                                      @sebastian-roth oui j’ai modifier mon fichier mais jusque là pas de changement au niveau du hotsname. mount /dev/sda1 /ext

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        julio @george1421
                                        last edited by Feb 2, 2021, 1:31 PM

                                        @george1421 en passant george je travail sur des VM sur virtualbox et lors de la création de mon pc ubuntu desktop, j’ai partitionner mon dique dur virtuel. es ce cela le problème.

                                        G 1 Reply Last reply Feb 2, 2021, 1:40 PM Reply Quote 0
                                        • J
                                          julio @george1421
                                          last edited by Feb 2, 2021, 1:39 PM

                                          @george1421 oui george, voici à quoi ressemble ma partition sur la machine cliente ubuntu.partion3.PNG partion2.PNG partion1.PNG

                                          G 1 Reply Last reply Feb 2, 2021, 1:46 PM Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 1 / 3
                                          1 / 3
                                          • First post
                                            10/51
                                            Last post

                                          162

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project