Answer the question
In order to leave comments, you need to log in
How to force sh script to be loaded in FreeBSD after reboot?
Hello!
Please help with your advice!
There is FreeBSD 12. It is
necessary that my sh-script is executed once every time the system boots.
Everything seems simple, but all the methods I found do not work!
This is not a service, so starting from rc.d is not needed, the script should be loaded once.
Of course everything works manually.
The file is made executable for everyone. I tried different owners, from root:wheel to nobody:nogroup.
Doesn't start.
I tried it through cron, added the @reboot root /usr/local/etc/flash_mysql_flags.sh line to crontab (without root too)
Added lines to crontab following the advice from the Internet:
SHELL=/usr/local/bin/bash
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/etc
Doesn't work.
And of course rc.local.
Also unsuccessful!
The script needs mysql, paused before the script, to no avail.
I tried to insert the touch command into rc.local instead of the script, it does not work.
I hope for your help.
Answer the question
In order to leave comments, you need to log in
added @reboot root /usr/local/etc/flash_mysql_flags.sh line to crontab (without root too)
chmod 755 flash_mysql_flags.sh
crontab -u root -e
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question