You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works fine with ./script.sh or sh /home/root/script.sh
When another script calls this script with the service, systemclt start Boot.service,
Forever seems lost he try to make the logs in /root/.forever instead of /home/root/.forever and try to bind to /root/.forever/pids instead of /home/root/.forever/pids. So I created this directories but now my script which works fine, accuse this problem:
Error: Cannot find module 'bonescript'
I think it is something to do with the Path, but I tried -p, --sourcedir and it is the same thing.
The problem only happen when the script is call from a service.
I have this bash:
/home/root/script.sh
!/bin/sh
DATA=
date +%Y-%m-%d-%H-%M-%S
/usr/bin/forever start -e /home/root/xptcv/log/errorPower-$DATA.log -o /home/root/xptcv/log/infoPower-$DATA.log --sourceDir /home/root/xptcv/ power.js
sleep 1
/usr/bin/forever start -e /home/root/xptcv/log/errorCarregador-$DATA.log -o /home/root/xptcv/log/infoCarregador-$DATA.log --sourceDir /home/root/xptcv/ carregador.js
sleep 1
/usr/bin/forever start -e /home/root/xptcv/log/errorBico-$DATA.log -o /home/root/xptcv/log/infoBico-$DATA.log --sourceDir /home/root/xptcv/ bico.js
sleep 2
/usr/bin/forever start -e /home/root/xptcv/log/errorServer-$DATA.log -o /home/root/xptcv/log/infoServer-$DATA.log --sourceDir /home/root/xptcv/ server.js
Works fine with ./script.sh or sh /home/root/script.sh
When another script calls this script with the service, systemclt start Boot.service,
Forever seems lost he try to make the logs in /root/.forever instead of /home/root/.forever and try to bind to /root/.forever/pids instead of /home/root/.forever/pids. So I created this directories but now my script which works fine, accuse this problem:
Error: Cannot find module 'bonescript'
I think it is something to do with the Path, but I tried -p, --sourcedir and it is the same thing.
The problem only happen when the script is call from a service.
/lib/systemd/system/Boot.service
[Unit]
Description=Boot
After=syslog.target network.target
[Service]
Type=simple
ExecStart=/home/root/boot.sh
[Install]
WantedBy=multi-user.target
/home/root/boot.sh
!/bin/bash
DATA=
date +%Y-%m-%d-%H-%M-%S
while [ ! -d "/media/BACKUP/backup" ]
do
sleep 1
done
tar -zcvf /media/BACKUP/backup/logs_bkp-$DATA.tar.gz /var/lib/cloud9/attic/xptcv/log/.log
sleep 1
rm /var/lib/cloud9/attic/xptcv/log/.log
tar -zcvf /media/BACKUP/backup/bds_bkp-$DATA.tar.gz /var/lib/cloud9/autorun/*.db
sleep 1
sh /home/root/script.sh
If I execute the boot.sh I have no problem.
The text was updated successfully, but these errors were encountered: