Rhel 7.1 and getting TACTICv4.4.0.v03 to start as a service.

3 posts / 0 new
Last post
Troger
Rhel 7.1 and getting TACTICv4.4.0.v03 to start as a service.

So I've gotten pretty far with my new TACTIC install and I'm very excited! I used the CentOS install docs and aside from a couple of tweaks:

  • Rhel 7 uses 'firewalld' to manage iptables...
  • you don't start/stop services by doing a /etc/init.d/httpd restart... instead you do a service httpd restart...
  • Had to uncomment "Require all granted" in a couple spots in /etc/httpd/conf.d/tactic.conf in order to get images to load...

but otherwise it was pretty  much the same...
 
Until I got to installing it as a service... I can run the command:
su apache -s /bin/bash -c "python /opt/tactic/tactic/src/bin/startup.py"

 

And Tactic starts up great, but when I change the line in /opt/tactic/tactic/src/install/service/tactic and follow the steps including "service tactic start" to run it as a service it won't start and I don't see any errors and it doesn't launch at startup. The command line says [OK]:

[root@tac log]# service tactic start
TACTIC_INSTALL_DIR = /opt/tactic/tactic
TACTIC_SITE_DIR = 
TACTIC_DATA_DIR = /opt/tactic/tactic_data
 
Starting tactic (via systemctl):                           [  OK  ]
 
 and when I tail the /var/log/message I get the following:
 
May 10 22:10:01 tac systemd: Created slice user-0.slice.
May 10 22:10:01 tac systemd: Starting Session 75 of user root.
May 10 22:10:01 tac systemd: Started Session 75 of user root.
May 10 22:10:20 tac systemd: Started SYSV: Startup script for Tactic on UNIX systems..
 
 
I did find the following in [root@tac log]# cat /var/log/tactic
----------------------------------------------------------------------
This account is currently not available.
/etc/rc.d/init.d/tactic: line 110: kill: (4606) - No such process
/etc/rc.d/init.d/tactic: line 111: kill: (4606) - No such process
----------------------------------------------------------------------
This account is currently not available.
/etc/rc.d/init.d/tactic: line 110: kill: (12477) - No such process
/etc/rc.d/init.d/tactic: line 111: kill: (12477) - No such process
----------------------------------------------------------------------
This account is currently not available.
/etc/rc.d/init.d/tactic: line 110: kill: (4415) - No such process
/etc/rc.d/init.d/tactic: line 111: kill: (4415) - No such process
----------------------------------------------------------------------
su: ignore --preserve-environment, it's mutually exclusive to --login.
This account is currently not available.
 
But because there's no timestamps and it doesn't keep appending similar errors every time I run "service tactic start" then I don't think these are related to my problem :(
 
Please help! I'm so close, but I'm stumped on how to get this thing to run as a service at restart...
 
Thanks,
Troy
Diego
Diego's picture

Hi troger,
this is how I install tactic con centos 7:
 
## --- First install a centos 7 minimal
## --- login as root
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload
yum -y update
reboot
##
yum -y install httpd postgresql postgresql-server postgresql-contrib python-lxml python-imaging python-crypto python-psycopg2 ImageMagick unzip git vim
curl -O http://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz
tar xvf ffmpeg-git-64bit-static.tar.xz
cp ffmpeg-git-*-64bit-static/ffmpeg ffmpeg-git-*-64bit-static/ffmpeg-10bit ffmpeg-git-*-64bit-static/ffprobe ffmpeg-git-*-64bit-static/ffserver ffmpeg-git-*-64bit-static/qt-faststart /usr/local/bin/
rm -f ffmpeg-git-64bit-static.tar.xz
rm -rf ffmpeg-git-*-64bit-static
postgresql-setup initdb

## Get the official dist from community site:
curl -O http://community.southpawtech.com/sites/default/files/download/TACTIC%20...
unzip TACTIC-4.4.0.v03.zip
mv TACTIC-4.4.0.v03 TACTIC
## or get the dev branch from github:
# git clone -b 4.5 https://github.com/Southpaw-TACTIC/TACTIC.git
# ----

unalias cp
cp -f TACTIC/src/install/postgresql/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf
chown postgres:postgres /var/lib/pgsql/data/pg_hba.conf
systemctl enable postgresql.service
systemctl start postgresql.service
python TACTIC/src/install/install.py -d
## you'll get a couple of questions answer Yes and few sql errors, ignore them
cp /home/apache/tactic_data/config/tactic.conf /etc/httpd/conf.d
sed -i "s/#Require all granted/Require all granted/g" /etc/httpd/conf.d/tactic.conf
systemctl enable httpd.service
systemctl start httpd.service
# vim /home/apache/tactic_data/config/tactic-conf.xml # (here it is possible to change tactic configuration, not required)
chsh -s /bin/bash apache

## Now you can launch tactic in dev mode (it will stay in foregound and print debug infos):
su - apache -c "python /home/apache/tactic/src/bin/startup_dev.py"

## Or configure it as a service to auto start at boot time:
cp /home/apache/tactic/src/install/service/tactic /etc/rc.d/init.d/
chmod 755 /etc/rc.d/init.d/tactic
chkconfig tactic on
systemctl start tactic.service
 

Diego

Troger

Turns out the problem I was running into was because the apache account has no login shell. I was able to get it to run as a service by changing the launch string in  /etc/init.d/tactic to: 
su - $TACTIC_USER -s /bin/bash -m -c "$LAUNCH" >> $LOG 2>&1 &
Restarted the box and boom! It's running as a service now :)