I have a systemd unit file that starts two completely separate processes, apache and tomcat (and before you comment on it, I know I should just make two separate unit files, but permissions on this server are locked down tight). When starting the service through an SSH session, everything starts and stops just fine. However, when the server reboots, only apache starts back up, with systemd claiming everything is fine. When I check the tomcat logs, it appears to have started, but the process just dies at some point.
What could be causing this difference in behavior? Does this service need to wait on something else before starting?
Unit file:
[Unit]
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/home/opiusr/appstart.sh
ExecStop=/home/opiusr/appstop.sh
[Install]
WantedBy=multi-user.target
Both scripts are wrappers that contain something like this:
/bin/su - opiusr -c "/home/opiusr/bin/start_tomcat -s" >> $LOG_FILE
/bin/su - opiusr -c "/home/opiusr/bin/start_apache -s" >> $LOG_FILE
And those scripts simply wrap the tomcat and apache start and stop scripts, with some extra logging.
EDIT: I've seen this answer that is quite similar: Systemd kills service immediately after start
I'm wondering if I can do something else, seeing as the system is pretty locked down. I have full edit access to the unit file, and the two scripts, just not the ability to create new services or touch system directories.