Python repeatedly causing a crash when executing daemons - python

I'm not a programmer or anything like that, but I recently installed some python scripts and I'm struggling to execute them as part of a workflow on startup. I run an automator workflow that executes these three separate commands:
python /Applications/Sick-Beard/Sickbeard.py --daemon
python /Applications/CouchPotatoServer/CouchPotato.py --daemon
python /Applications/Headphones/Headphones.py --daemon
I can run these commands in a terminal window without any problem. However, when executing the commands as a single workflow or even three separate ones in quick succession, it always yields the follow error.
I'm at my wits end. Your help is very appreciated. The same error is caused when I create .plit LaunchAgents.
Thanks in advance, your help is more than appreciated. I had to put this on pastebin because I kept on getting formatting errors.
http://pastebin.com/qb65Mc53

Related

How do I debug through a gdb helper script written in python?

there may very well be an answer to this question, but it's really hard to google for.
you can add commands to gdb by writing them in python. I am interested in debugging one of those python scripts that's running in gdb session.
my best guess is to run gdb on gdb and execute the user added command and somehow magically break on the python program code?
has anybody done anything like this before? I don't know the mechanism by which gdb calls python code, so if it's not in the same process space as the gdb that's calling it, I don't see how I'd be able to set breakpoints in the python program.
or do I somehow get pdb to run in gdb? I guess I can put pdb.set_trace() in the python program, but here's the extra catch: I'd like to be able to do all this from vscode.
so I guess my question is: what order of what things do I need to run to be able to vscode debug a python script that was initiated by gdb?
anybody have any idea?
thanks.
so I figured it out. it's kinda neat.
you run gdb to debug your program as normal, then in another window you attach to a running python program.
in this case the running python program is the gdb process.
once you attach, you can set breakpoints in the python program, and then when you run commands in the first window where the gdb session is, if it hits a breakpoint in the python code, it will pop up in the second window.
the tipoff was that when you run gdb there does not appear to be any other python process that's a child of gdb or related anywhere, so I figured gdb must dynamically link to some python library so that the python compiler/interpreter must be running in the gdb process space, so I figured I'd try attaching to that, and it worked.

Makefile runs default-python

I'm running the command
make config=default_config.mk task
with task being different tasks I can run. The entire program is pretty dated with very little support. The 'default_config.mk' file lets you change directorys, after that the programm is supposed to work.
It turns out the makefile runs the default-python. The Makefile basically runs a bunch of different .py-files.
I've already created an alias for python3 which works in the terminal, but not when I run the program. I've now created a new Makerun-file and changed every python to python3. Apart from that and adding '#!/bin/bash' to the first line (to make it executable?) it should be the same file.
Now, I keep getting the error
make: *** No rule to make target `task'. Stop.
Does anyone have an idea?
Thank you
Edit:
So I've managed to install Psycopg2 to Python 2.7, now it throws an error for the command:
python SciGRID.py --dbpwrd $(postgres_password)
Error:
SciGRID.py: error: --dbpwrd option requires an argument
The Programm is supposed to run on Python 2.7. I think the best way would be to change the Makefile, but that's when the error "no rule..." appears. If I use the default Makefile I basically keep running into errors as its pretty dated. Why is it not accepting the edited makefile?

Debugging htcondor issue running python script

I am submitting a python script to condor. When condor runs it it gets
an import error. Condor runs it as
/var/lib/condor/execute/dir_170475/condor_exec.exe. If I manually copy
the python script to the execute machine and put it in the same place
and run it, it does not get an import error. I am wondering how to
debug this.
How can I see the command line condor uses to run it? Can the file
copied to /var/lib/condor/execute/dir_170475/condor_exec.exe be
retained after the failure so I can see it? Any other suggestions on
how to debug this?
You can simply run an interactive job (basically just a job with sleep or cat as command) and do ssh_to_job to run it.
Generally you need to set-up your python environment on the compute node, it is best to have a venv and activate it inside your start script.

FreeCAD does not execute the python script as expected

I'm trying to learn FreeCAD python scripting. Basically I open the python console and do what I want to do in the GUI and then look into the python console to learn the commands. and then read the API for that specific task to learn the correct form of python commands.
Things were going fine till I got stuck in this weird issue where the program (I.E FreeCAD) does not execute parts of my code. For example in this macro I create three boxes and then fuse two toghther, and it works just fine. But in this one I create 3 boxes, fuse two of them together, and then try to cut the fusion out of the bigger box. and it doesn't work. I even tried including some flags using print("flag"), but it does not execute these commands. If I copy and past the exact commands into the python consol and run it works fine!
so my speculations are:
FreeCAD does something in the GUI which does not report in the python console.
FreeCAD python interpreter does not execute some commands such as print("")
there is something in FreeCAD API which I'm not using correctly
I would appreciate if you could help me know:
if this is a bug in FreeCAD/python or it is intentional
how can I solve the issue so the FreeCAD python interpreter runs my macro/script as I expect?
P.S. I posted the exact same question here in FreeCAD forum.
OK, I figured the problem out. you may see the correct macro here in this Github Gist
explanation: Basically the solution is that when we want to run a Boolean operation on two existing objects we should not change their visibility to false (as the default GUI commands do). If we include those commands then none of the commands after them will be executed.

Status Information: 127, plugin may not be installed

So, the title pretty much says it. I'm trying to customize several plugins for nagios and several of them have to be in python.
I'm running Centos 6.5, Python 2.6.6, and Nagios Core 3.5.1
I've installed nagios and python use the yum repository, and everything works when run from the command line, even as the nagios user. I can get bash scripts to run from the nagios system just fine, but even trying to wrap the python in a bash script doesn't work. Whatever I run, even something as simple as
echo `/usr/bin/python --version`
returns an empty or null string.
It also apparently exits with status zero (even when the run code should have produced something else) no matter what I do. This problem appears to be specific to Python and not have anything to do with basic permissions. It might have something to do with ACLs, though I have no idea what. Does anyone have any ideas for what might be going wrong?
Nagios can display some really odd behaviors when things exit with an unknown status and no output. It turns out that a good first debugging step is to try adding something like
<command> 2>&1
or
echo `<command> 2>&1`
to your plugin call to check what stderr is telling you.

Categories

Resources