solve bug: rtl-fm and multimon-ng not found (daemon)

the programs are not in the path when you want to start the daemon on systemstart
This commit is contained in:
JHCD 2015-06-25 19:46:59 +02:00
parent 727379c237
commit f54debb44e
2 changed files with 7 additions and 7 deletions

View file

@ -224,7 +224,7 @@ try:
# Start rtl_fm
#
logging.debug("starting rtl_fm")
command = "rtl_fm -d "+str(args.device)+" -f "+str(converter.freqToHz(args.freq))+" -M fm -s 22050 -p "+str(args.error)+" -E DC -F 0 -l "+str(args.squelch)+" -g 100"
command = "/usr/local/bin/rtl_fm -d "+str(args.device)+" -f "+str(converter.freqToHz(args.freq))+" -M fm -s 22050 -p "+str(args.error)+" -E DC -F 0 -l "+str(args.squelch)+" -g 100"
rtl_fm = subprocess.Popen(command.split(),
#stdin=rtl_fm.stdout,
stdout=subprocess.PIPE,
@ -240,7 +240,7 @@ try:
# Start multimon
#
logging.debug("starting multimon-ng")
command = "multimon-ng "+str(demodulation)+" -f alpha -t raw /dev/stdin - "
command = "/usr/local/bin/multimon-ng "+str(demodulation)+" -f alpha -t raw /dev/stdin - "
multimon_ng = subprocess.Popen(command.split(),
stdin=rtl_fm.stdout,
stdout=subprocess.PIPE,

View file

@ -14,15 +14,15 @@ We recommend to use "-u" and "-q" when you want to run BOSWatch as a daemon.
##### Using the init script
To actually use this script, put your Python script where you want (recommend `/usr/local/bin/BOSWatch`)
To actually use this script, put BOSWatch where you want (recommend `/usr/local/bin/BOSWatch`)
and make sure it is executable (e.g. `sudo chmod 755 boswatch.py`).
Edit the init script accordingly. Copy the init script into /etc/init.d using e.g. `sudo cp boswatch.sh /etc/init.d`.
Edit the init script accordingly. Copy it into /etc/init.d using e.g. `sudo cp boswatch.sh /etc/init.d`.
Make sure the script is executable (chmod again) and make sure that it has UNIX line-endings.
At this point you should be able to start your Python script using the command `sudo /etc/init.d/boswatch.sh start`,
At this point you should be able to start BOSWatchcd ~/srt using the command `sudo /etc/init.d/boswatch.sh start`,
check its status with the `sudo /etc/init.d/boswatch.sh status` argument and stop it with `sudo /etc/init.d/boswatch.sh stop`.
To make the Raspberry Pi use your init script at the right time, one more step is required:
Running the command `sudo update-rc.d boswatch.sh defaults`.
This command adds in symbolic links to the `/etc/rc.x` directories so that the init script is run at the default times.
You can see these links if you do ls -l /etc/rc?.d/*boswatch.sh
This command adds in symbolic links to the /etc/rc.x directories so that the init script is run at the default times.
You can see these links if you do `ls -l /etc/rc?.d/*boswatch.sh`