Problem with crontab/init.d
Sergio Fernández
sergio.fernandez at electronicamartinez.com
Fri Mar 25 17:58:30 EDT 2016
Hello again!
I have a problem while trying to start GenieACS at bootup, using crontab
or init.d
Normally, what it works is to cd to root directory /// and perform an
/sh genieacs-start.sh/.
The bash script /genieacs-start.sh/ contains the following:
/#!/bin/sh//
//if tmux has-session -t 'genieacs'; then//
// echo "GenieACS is already running."//
// echo "To stop it use: ./genieacs-stop.sh"//
// echo "To attach to it use: tmux attach -t genieacs"//
//else//
// tmux new-session -s 'genieacs' -d//
// tmux send-keys './genieacs/bin/genieacs-cwmp 2>&1 | tee
genieacs-cwmp.log' 'C-m'//
// tmux split-window//
// tmux send-keys './genieacs/bin/genieacs-nbi 2>&1 | tee
genieacs-nbi.log' 'C-m'//
// tmux split-window//
// tmux send-keys './genieacs/bin/genieacs-fs 2>&1 | tee
genieacs-fs.log' 'C-m'//
// tmux split-window//
// tmux send-keys 'cd genieacs-gui' 'C-m'//
// tmux send-keys 'rails server' 'C-m'//
// tmux select-layout tiled 2>/dev/null//
// tmux rename-window 'GenieACS'//
//
// echo "GenieACS has been started in tmux session 'genieacs'"//
// echo "To attach to session, use: tmux attach -t genieacs"//
// echo "To switch between panes use Ctrl+B-ArrowKey"//
// echo "To deattach, press Ctrl+B-D"//
// echo "To stop GenieACS, use: ./genieacs-stop.sh"
/If from*crontab* I perform any of these possibilities, it doesn't work:
@reboot sh /startAll.sh
@reboot cd / && sh genieacs-start.sh 2>&1 /var/log/genieacs-start.log
@reboot /genieacs/bin/genieacs-cwmp 2>&1 /var/log/genieacs-cwmp.log
@reboot /genieacs/bin/genieacs-nbi 2>&1 /var/log/genieacs-nbi.log
@reboot /genieacs/bin/genieacs-fs 2>&1 /var/log/genieacs-fs.log
where file //startAll.sh /contains the following:
/cd / && sh genieacs-start.sh 2>&1 /var/log/genieacs-start0.log/
On the other hand, if I incorporate an init script on*init.d *of the
genieacs-start.sh modifying the directories, it also doesn't work.
The thing is that even now I'm trying to reproduce the exact problem as
I am telling, I can't get the output log work. I know that is failing
because the genieacs-cwmp script is failing and I don't get response
from the devices.
The other times I had an error like "|js-bson: Failed to load c++ bson
extension, using pure JS version"||
|
Or like "Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
at RedisClient.on_error
(/genieacs/node_modules/redis/index.js:196:24)" (but the gui was working).
Thank you in advance for your help!
Sergio Fernández.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20160325/2ea29b93/attachment.html>
More information about the Users
mailing list