Using launched and plist starts late - plist

I recently tried to switch to launched on my Mac Mini (10.7.5) from cron on a PC. I searched and think I have things set up right, but it seems that the scheduled script starts significantly after the requested time. Details below.
Plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>RecordBluesA</string>
<key>ProgramArguments</key>
<array>
<string>/Users/gkd/scripts/script_record_blues_a.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>19</integer>
<key>Minute</key>
<integer>00</integer>
<!-- Test by trying everyday
<key>Weekday</key>
<integer>6</integer>
-->
</dict>
<key>StandardErrorPath</key>
<string>/tmp/RecordBluesA.err</string>
<key>StandardOutPath</key>
<string>/tmp/RecordBluesA.out</string>
</dict>
</plist>
script_record_blues_a.sh :
export DISPLAY=:0.0
script=$0
echo "Starting $script at `date`\n"
date=`date +%Y%m%d`
mplayer -playlist http://wxpnhi.streamguys.com/listen.pls -dumpstream -dumpfile ~/RecordedMusic/${date}_BluesA.mp3 &
PID=$!
# Kill after 2 hours minus a minute
# sleep 7140
# Debug, running for a little
sleep 120
echo "Killing mplayer (PID=$PID) at `date`\n"
kill $PID
echo "Ending $script at `date`\n"
Top of the "StandardOutPath" file:
Starting /Users/gkd/scripts/script_record_blues_a.sh at Wed Sep 23 19:11:59 EDT 2015
So it seems like 12 minutes late . . .
I "launchctl load" it, and a list shows it waiting:
Mon Sep 28 13:33 gkd ~/Library/LaunchAgents: launchctl list|grep -i record
- 0 RecordThistle
- 0 RecordBluesB
- 0 RecordBluesA
- 0 com.apple.coredata.externalrecordswriter
When I was testing manually, setting the plist "Minute" to a few minutes in the future, it seemed to start when expected, and the "launchctl list" then indicated non-hyphen PIDs. So I wrapped everything together and enabled it for a few days away, then checked afterwards, and it hadn't started on time, but more like 20 some minutes too late. Any thoughts on what's wrong? Thanks.

The Mac was "sleep"ing when the job should start. So now I don't let it sleep, and everything works.

Related

Arduino Pro Micro not uploading any code (avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied)

I tried uploading any kind of sketch (including the bare bones one), and nothing worked. Other people said this error was caused by a lack of permissions on the port, and so I did what was suggested by several others and the arduino site (for linux).
Sketch uses 3462 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyS4, } / {/dev/ttyACM0, /dev/ttyS4, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS4, } / {/dev/ttyS4, } => {}
PORTS {/dev/ttyS4, } / {/dev/ttyACM0, /dev/ttyS4, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/home/kalin/Downloads/arduino-1.8.13/hardware/tools/avr/bin/avrdude -C/home/kalin/Downloads/arduino-1.8.13/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/arduino_build_767551/sketch_feb05a.ino.hex:i
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/kalin/Downloads/arduino-1.8.13/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/kalin/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : avr109
Overriding Baud Rate : 57600
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
avrdude done. Thank you.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
From the documentation:
Open Terminal and type:
ls -l /dev/ttyACM* you will get something like:
crw-rw---- 1 root dialout 188, 0 5 apr 23.01 ttyACM0 The "0" at the
end of ACM might be a different number, or multiple entries might be
returned. The data we need is "dialout" (is the group owner of the
file).
Now we just need to add our user to the group:
sudo usermod -a -G dialout $USER then:
sudo chmod a+rw /dev/ttyACM0 You will need to log out and log in again
for this change to take effect.
However every time I launched arduino, the permissions would be cleared back to what it was before. If I ran arduino as sudo it worked, but I obviously shouldn't need to do that.
I'm not experienced enough to know what programmer to use for the arduino, but the issue was I was using "AVR ISP", but when I switched to "ArduinoISP" everything uploaded perfectly. There was no need to change any permissions.

Equivalent of nf_conntrack on firewalld for dynamically opening SIP RTP ports

When using netfilter/iptables you could set nf_conntrack to read your SIP signalling messages on port 5060 and it would automatically open up the required RTP ports for audio to pass for that call.
Can anyone please explain or help me find the equivalent for doing this with firewalld on CentOS 7?
I know I can open up an entire range but I like only having necessary ports open.
EDIT 1 - This suggests that nf_conntrack is scheduled for a later release, but that info is at least 8 months old (as it's referred to here, dated 16th April). Is there another way?
In /etc/firewalld/services, create a service definition, i.e. sip.xml with the following contents:
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>SIP</short>
<description>SIP over UDP on port 5060</description>
<port protocol="udp" port="5060"/>
<module name="nf_conntrack_sip"/>
</service>
To permanently add that to your default zone:
# firewall-cmd --add-service=sip --permanent
And to apply that:
# firewall-cmd --reload
At this point, if you look at lsmod, you should see that the nf_conntrack_sip module is loaded, e.g.
# lsmod |grep sip
nf_conntrack_sip 33860 0
nf_conntrack 105702 7 nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_conntrack_sip,nf_conntrack_ipv4,nf_conntrack_ipv6

Looking for a SWS call for a specific host command

What is an equivalent SWS call for the following host command:
PI/TRAVELER/823144910-1.1
I am trying to associate a guest profile with a guest on a PNR.
You also have the option to use SabreCommandLLSRQ to send the native PI/TRAVELER/823144910-1.1 command.
<SabreCommandLLSRQ xmlns="http://webservices.sabre.com/sabreXML/2003/07" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" EchoToken="String" TimeStamp="2001-12-17T09:30:47-05:00" Target="Production" Version="2003A.TsabreXML1.6.1" SequenceNmbr="1" PrimaryLangID="en-us" AltLangID="en-us">
<Request Output="SCREEN" CDATA="true">
<HostCommand>PI/TRAVELER/823144910-1.1</HostCommand>
</Request>
The only way to add a Profile Index (PI) to a PNR is to use the ProfileToPNR service that moves the profile into the PNR.

Monit failing to start process

I have a simple script that I'm trying to get Monit to monitor. After some digging around I found this little nugget: start program = "su - myuser -c '/home/user/myscript.rb start' " which I believe should work but looking at the log files it says:
[PDT Oct 30 02:47:17] info : 'simple_script' start: su
[PDT Oct 30 02:47:17] error : Error: Could not execute su
Likewise earlier attempts only seem to read the part preceding a space so:
start program = "/home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /home/user/simple_script_daemon.rb stop"
results in…
[PDT Oct 30 03:09:49] info : 'simple_script' start: /home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
Which doesn't fail like the first example but still seems to only execute the part preceding the space.
This is my full statement:
check process simple_script
with pidfile /home/user/simple_script.rb.pid
start program = "su - user -c '/home/user/simple_script_daemon.rb start' "
stop program = "su - user -c '/home/user/simple_script_daemon.rb stop' "
group simple_script
If you've got an idea what might be going on I'd love to hear from you!
I guess you could try something like:
check process simple_script
with pidfile /home/user/simple_script.rb.pid
start program = "/home/user/simple_script_daemon.rb start" as uid user and gid user
stop program = "/home/user/simple_script_daemon.rb stop" as uid user and gid user
group simple_script
as stated in monit doc.
You may need to provide full path to su, i.e. /bin/su

OpenVAS fails to respond with more than 8192 bytes

I'm requesting a HTML report from an OpenVAS server the following way:
<?xml version="1.0" encoding="utf-8"?>
<commands><authenticate><credentials><username>***</username><password>***</password></credentials></authenticate><get_reports report_id="454a3397-b8a4-408e-9f55-f08972765d30" format_id="b993b6f5-f9fb-4e6e-9c94-dd46c00e058d"/></commands>
However when I read the response I receive only 8192 bytes, which happens not to hold all the HTML code. Is this is a hardcoded limit? How do I get around it?
I have found a similar issue. The cause was related to running
openvas-mkcert-client -n admin -i
Note the trailing -i, this is what causes the break. I have found no solution.

Resources