12-10-2019, 02:14 PM
More than likely, you will have to run this script as root (init.d scripts always run as root)
You have the line:
[fedora@ip-172-31-24-227 init.d]$ sudo -u apache ./tactic_python3 start
which runs it as apache. This "tactic_python3" will start monitor.py as the user set in line 29
29 TACTIC_USER=tactic
We used to run TACTIC as user apache, but a few years back we switched to a "tactic" user, so all of our documentation and scripts reflect this. If you want to run it as apache, you can, but you will have to change line 29 to reflect this. My guess is that your problems stem from permissions issues dealing with running the script as user "apache" which tries to run "monitor.py" as a user "tactic". The apache user would not be permitted to do that.
Your script is failing at:
78 if kill -0 $PID >&-; then
If may also be that you have a $PID file that it is trying to kill and it can't.
After line:
32 PID_FILE=$TACTIC_TEMP_DIR/log/tactic.pid
echo the PID_FILE to see the location and then try to remove that file first and see if that helps.
You have the line:
[fedora@ip-172-31-24-227 init.d]$ sudo -u apache ./tactic_python3 start
which runs it as apache. This "tactic_python3" will start monitor.py as the user set in line 29
29 TACTIC_USER=tactic
We used to run TACTIC as user apache, but a few years back we switched to a "tactic" user, so all of our documentation and scripts reflect this. If you want to run it as apache, you can, but you will have to change line 29 to reflect this. My guess is that your problems stem from permissions issues dealing with running the script as user "apache" which tries to run "monitor.py" as a user "tactic". The apache user would not be permitted to do that.
Your script is failing at:
78 if kill -0 $PID >&-; then
If may also be that you have a $PID file that it is trying to kill and it can't.
After line:
32 PID_FILE=$TACTIC_TEMP_DIR/log/tactic.pid
echo the PID_FILE to see the location and then try to remove that file first and see if that helps.