shutdown after image with postdownloadscripts



  • Hello foggers!
    Fog normally reboots a machine after partclone; however: this is unwanted behavior for me because I need some control over that.
    I’ve tried a postdownloadscript like the one below:

    #!bin/sh
    shutdown -h now

    and
    #!bin/bash
    shutdown -h now

    but the FOS reports that the ‘shutdown’ command is unknown.
    I am still kind of new to Linux, but I guess that this command isnt a part of the kernel?

    However; the machine reboots… so there must be some kind of option available?


  • Developer

    Tom is absolutely right about shutdown before the job actually finishes is not a good idea.

    But just in case people want to do other things in the postdownloadscript and run into the same “command is unknown” issue. My guess is that the PATH environment is not properly set within the scripts. So you’d need to call /sbin/shutdown to make it work…



  • @Tom-Elliott
    O my… this was so hidden in plain sight that I never noticed the gigantic underlined ’ Shutdown’ just staring at me…

    This is why I ask my questions on the forums; you guys are just awsome.


  • Moderator

    @Tom-Elliott said :

    When you create the tasking, you can choose to have the system shutdown when complete.

    I was thinking there was a built in option for this!! But I don’t have immediate access to the console to confirm.


  • Senior Developer

    This is important because postdownload scripts occurs BEFORE the task is completed in the database.


  • Senior Developer

    When you create the tasking, you can choose to have the system shutdown when complete.


  • Moderator

    While I don’t have an immediate answer for you, I would go about it this way.

    As a test, setup a debug download to a test computer. Then deploy to a test system. This debug deploy will drop you to the command prompt on the target computer, but you will be inside the FOS client. FOS is a custom linux OS specifically built for speed. It may not have the shutdown command in the inits or it uses a different command to restart a the target computer. I would start this way to investigate what tools are included.


Log in to reply
 

446
Online

39.3k
Users

11.0k
Topics

104.6k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.