I'm using aws-iot-sdk-js "jobs-agent.js" to "install packages" ( but really just put files and execute commands). The following works just fine:
(Note, I have a cron job writing "[]" to "installedPackages.json" every minute to prevent all the package management stuff from happening, hence "doesntmatter". Yes, I know it's hacky.)
{
"operation": "install",
"packageName": "doesntmatter",
"workingDirectory": "/home/pi/tamgbin",
"launchCommand": "chmod 755 /home/pi/tamgbin/sessionValidator && chmod 755 /home/pi/tamgbin/tagGenerator && rm /home/pi/tamgbin/*.old",
"autoStart": "false",
"files": [
{
"fileName": "sessionValidator",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/sessionValidator"
}
},
{
"fileName": "tagGenerator",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/tagGenerator"
}
},
{
"fileName": "tamgSessionValidator.jar",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/tamgSessionValidator.jar"
}
},
{
"fileName": "tamgTagGenerator.jar",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/tamgTagGenerator.jar"
}
}
]
}
My files get placed and the launchCommand executes perfectly. The only problem is, in the IOT console, the job is listed as "failed" and "completed".
Why? The console doesn't give any useful information about the WHY of the failure.