fog.postinit not executing

    • Fog v1.5.5 on Ubuntu 16.04
    • Kernel 4.19.1

    I’ve recently migrated my fog server to a new machine and have had some interesting issues and learned a lot about migration of fog.

    However when it came to moving over the “full host registration and inventory” customized I had on the old server to the new server it stopped working.

    On the old server the fog.postinit file looked like so :

    ## This file serves as a starting point to call your custom pre-imaging/post init loading scripts.
    ## <SCRIPTNAME> should be changed to the script you're planning to use.
    ## Syntax of post init scripts are
    #. ${postinitpath}<SCRIPTNAME>
    echo "Installing Patch"
    cp -f ${postinitpath} /bin/
    echo "Done Patching stuff"

    And I scp’d it to the new server.

    I’m at a loss as to why it’s not working on the new server. My first thought were permissions and the permissions match on both servers.

    original-server:/images/dev/postinitscripts$ls -l
    total 16
    -rwxr-xr-x 1 deploy deploy 10491 Apr  2 17:45
    -rwxrwxrwx 1 fog    root     379 Apr  2 17:49 fog.postinit
    new-server:/images/dev/postinitscripts$ls -l
    total 16
    -rwxr-xr-x 1 fog    deploy 10491 Apr  6 21:34
    -rwxrwxrwx 1 fog    root     378 Apr  7 12:53 fog.postinit

    Could someone please help me figure out why this is happening?


  • @Tom-Elliott yes is the new server’s ip.

    I’ve also tried moving the contents of fog.postinit to a dedicated patch.reg script, set to 755, and called from fog.postinit as mentioned in another post detailing this and the fog.postinit instructions themselves with no success:

     . ${postinitpath}patch.reg

    Updated the kernel too. No joy.

    Also , while in debug mode on the client , I attempted to echo ${postinitpath} and it returned a blank line.

  • Senior Developer

    @lucycle now is your new server up address?

    The error is expected at the end there.

  • @Tom-Elliott Ok these are images from debug mode on a host:

    alt text


    alt text

    It’s not very descriptive but I’m searching through the forums now to see if something similar has been posted about already.

  • Senior Developer

    @lucycle The password for the linux fog users is not what’s preventing the fog.postinit file to run.

    An option that may work better, then, would be to run a task in debug mode.

    As this issue is happening on registration ( I’m guessing), you’ll want to add:

    isdebug=1 to the FOG_KERNEL_ARGS found in FOG Configuration->FOG Settings.

    Then try to register a host.

    This will drop your machine (or any that will be booted after this is defined) to startup in debug mode.

    Press Enter key twice and you will be at a shell where you can type commands. From here, type the command fog and press Enter. As fog.postinit is one of the first things to run, I imagine we’ll see an error here. Can you get a picture of the error? Or at the least, what you see during this phase?

  • @Tom-Elliott Yes. Out of frustration I even copied over the init.xz files from the old server to the new one. I didn’t expect it to work and it didn’t.

    The only thing I can think of is the two fog users don’t have matching passwords (this was an issue for other hiccups along the way as I migrated) and the fog user ownership of fog.postinit only looks correct because it came from a system with an identically named user but is actually wrong because the old server’s fog account had a different password?

    BTW, after database and image migration the old server’s fog password hash needed to be copypasted into .fogdefaults and installer re-ran for everything else to run smoothly.

    This is why my thoughts went to permissions and/or mismatched users in the first place.

    I might just be misunderstanding how it all works in regards to fog.postinit however.

    BTW, have not had a chance to try chowning the file to the new fog user as I am not able to test it tonight.

  • Senior Developer

    What’s the contents of the fog.postinit on the new-server? I assume the contents you showed us are that of the old server

  • As a matter of fact nothing that I put in fog.postinit works. Even if it’s just echoing garbage to stdout. Pardon the reply to my own post , I don’t see an edit option and I’m new to this forum software.

Log in to reply