Snapin error return 1



  • Hello everyone,

    I have a little problem with Snapin…
    It returns error 1, it seems to me that it’s a legal problem, does anyone have any idea how to provide run-time scripts?


  • Developer

    @Warget Is this snapin issue solved?


  • Senior Developer

    @Warget I could be wrong, but maybe your implicit use of where the pkg file is located is causing issues?

    The client, when on Linux or macOS systems, runs at the root user, where as you’re running this manually, it’s running as your logged in user.

    In other words:
    ~/Downloads/Imprimantes.pkg when you manually run it is located as:
    /Users/<yourloggedinusername>/Downloads/Imprimantes.pkg, but as the Client runs it is: /root/Downloads/Imprimantes.pkg

    Mind you this would cause issues, particularly, if Imprimantes.pkg doesn’t exist on /root/Downloads/

    This all said, there really isn’t any need to run the sudo portion as the FOG Client runs as the root user.


  • Developer

    @Warget Usually real shell scripts start with a shebang (or magic line):

    #!/usr/bin/env bash
    cd ~/Downloads
    echo "password" | sudo -S installer -allowUntrusted -verboseR -pkg "~/Downloads/Imprimantes.pkg" -target /
    

    Give this a try. On the other hand it also could be a problem with the sudo command. When running this script in the terminal by hand you do this in your user context. The fog client executing this same script does it from a different context (account) which might not be allowed to run sudo.

    Anyhow… Having the password in the script is definitely not a good idea. Please read about ‘sudoers’, ‘NOPASSWD’ and such things on the net. This way you should be able to make this work and still have it a little more secure than saving the password in your script file.



  • @Sebastian-Roth said in Snapin error return 1:

    @Warget Nous devons encore en savoir plus sur le snapin réel que vous essayez de courir ici?

    My snapin is easy it’s a shell script :

    cd ~/Downloads
    echo "password" | sudo -S installer -allowUntrusted -verboseR -pkg "~/Downloads/Imprimantes.pkg" -target /
    

    If I execut by terminal it’s work.


  • Developer

    @Warget We still need to know more about the actual snapin you are trying to run here?!



  • @Quazz said in Snapin error return 1:

    Dans quel système d’exploitation tentez-vous de déployer des snapins?
    Quel type de snapin ???

    Indeed I have not been precise enough:
    FOG: 1.4.0
    OS: Debian 8
    OS client: Mac OS X Sierra

    LOG :
    alt text

    Error:
    I think error come from right


  • Moderator

    Maybe a little bit more information?

    What OS is the FOG server running?

    What version of FOG?

    Which OS are you trying to deploy snapins on?

    What kind of snapin???


 

532
Online

41.8k
Users

12.3k
Topics

116.0k
Posts