SNMP "exec format error" when trying to run a script
Asked Answered
B

1

6

I'm using SNMPD to run a script on a Raspberry Pi with net-snmp. I was able to get the same script running on my Slackware machine, but on the Pi, under extOutput.1, I'm getting "Exec format error".

The batch file being called is set to 777 and is:

#! /bin/bash
/sbin/reboot

Everything I've found about the error says that I would just need to include the #! at the beginning of the file and that would fix it, but it doesn't. I can run the script from the command prompt just fine, and /bin/bash obviously works also, but when called through SNMP (both snmpget and snmpwalk), the extOutput.1 line gives me that error.

Becalm answered 16/11, 2013 at 20:45 Comment(0)
B
15

Ugh. I had a blank line at the top of the script before the #! line.

Becalm answered 16/11, 2013 at 21:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.