0

I have a following script

#!/bin/bash
cd /var/www/html/bin/warpper/
source venv/bin/activate
screen -A -m -d -S screen_celery celery -A tasks.celery worker --loglevel=info -c1 
screen -A -m -d -S screen_app ./app.py

I tried adding to crontab with @reboot command, but I get error

(CRON) INFO (Skipping @reboot jobs -- not system startup)

I tried adding it to .bachrc , adding script to /etc/init.d and then running command

update-rc.d /etc/init.d/nameofscript.sh defaults

Also added to rc.local

And I also created the shell script like this

( cd /var/www/html/bin/warpper/ && source venv/bin/activate && screen -A -m -d -S screen_celery celery -A tasks.celery worker --loglevel=info -c1 && screen -A -m -d -S screen_app ./app.py )

I am not able to figure out what I am doing wrong.

1
  • 2
    what research have you done? ... your question has been asked many times
    – jsotola
    Mar 4 '20 at 20:19
1

After so much searching I figured that I had to add this after #!/bin/bash

### BEGIN INIT INFO
# Provides:          my-service-name
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: your description here
### END INIT INFO

Got it working now. Thanks

1
  • 1
    Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Mar 6 '20 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.