From f54debb44eccb732bda6b76e767e3332f8826477 Mon Sep 17 00:00:00 2001 From: JHCD Date: Thu, 25 Jun 2015 19:46:59 +0200 Subject: [PATCH] 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 --- boswatch.py | 4 ++-- service/README.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/boswatch.py b/boswatch.py index 41fbf8b..d160c72 100755 --- a/boswatch.py +++ b/boswatch.py @@ -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, diff --git a/service/README.md b/service/README.md index 3af43e7..7ad599d 100644 --- a/service/README.md +++ b/service/README.md @@ -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 \ No newline at end of file +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` \ No newline at end of file