SOLVED 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:

    shutdown -h now

    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?

  • Moderator

    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.

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

  • 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.