[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash script calling python script fails



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Jun 16, 2015 at 03:01:30PM +0200, rudu wrote:
> Le 16/06/2015 12:47, tomas@tuxteam.de a écrit :
> >On Tue, Jun 16, 2015 at 11:23:51AM +0200, rudu wrote:
> >>Hello,
> >>There's something I just can't figure out :

[...]

> Thank you Tomas,
> You're right I should have pasted my script in the first place (see below).
> By the way, you'll see I already thought about this $PATH thing, but
> unless I forgot something that doesn't seem to be the case here.
> So, briefly said, that line :
>             /usr/bin/python /home/rudu/DynHost/ipcheck.py $OPTIONS
> $LOGIN $PASSWORD $HOST >> $THISLOG
> runs as expected when the script is launched "manually" but nothing
> happens at boot time.

OK, next thing(s):
  (1) is the script readable by the user (probably root) from the point
    where the ifup is? (perhaps some intervening dir isn't readable)
  (2) perhaps /home or /home/rudu isn't mounted yet when that happens?
  (3) do you see anything in your log file (you should at least see the
    first "-----", that would answer (2). In that case you might want
    do do

      "test -f /home/rudu/DynHost/ipcheck.py && echo "readable" || echo "non-readable" >> $LOGFILE
    or something similar.

What gives you the impression that it's the invocation of the python
script what is failing? How does the output to $LOGFILE look in the
failing case?

(BTW  I didn't go with too a fine comb through your script, but it looks
basically sensible. I wouldn't wget to a file but directly pass the result
through grep (wget -O - | grep ...), and I'd redirect the output of the
python script >> $LOGFILE, instead of passing it through $THISLOG, but
those are minor nits which shouldn't alter the result).
oRegards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlWAKlcACgkQBcgs9XrR2kaEnACfRGWO32QioXCeoYRzwJYI0H4x
mnEAn2Wo3sn1wZ1XgnALCbeDtyt3jKA2
=t2BO
-----END PGP SIGNATURE-----


Reply to: