Services are not running. Where are the logs?
-
@dolf Although it seems to not do the trick in your case Tom is right about saying that
sudo su
does not give you a real proper root shell. While it does switch the user it does not load all the environment (/etc/profile and ~/.bash_profile) which might give you a different behavior in some cases. I have seen issues where starting some of the init services would work but restarting the squid web proxy would just not! Never found out why that is. I suppose it’s the PATH variable not being set properly (/sbin
and/usr/sbin
missing).Good you found the init PHP files. Obviously was a bit distracted when I wrote this. What if you run one of the scripts by hand
/opt/fog/service/FOGImageReplicator/FOGImageReplicator
?? -
Eureka! It says:
Missing Extensions: mysqliroot
-
@dolf Please run this
find / -xdev -fname "php.ini*" -exec grep "extension" {} /dev/null \;
and post the output here. -
I took the liberty of first:
- Correcting the command:
find / -xdev -name "php.ini*" -exec grep "extension" {} /dev/null \;
- Uninstalling php5 (since I have php5.6 installed, too)
Here is the output: php_extensions.txt
Then I tried this:
# apt-get install php5.6-mysql # phpenmod mysqli
It runs! BUT there is another error:
PHP Fatal error: Call to undefined function curl_init() in /var/www/html/fog/lib/fog/fogurlrequests.class.php on line 49
But it didn’t stop running, and a log file appeared at
/opt/fog/log
! - Correcting the command:
-
And then:
# rm /var/run/fog/*
# service FOGImageReplicator status * FOGImageReplicator is not running # service FOGImageReplicator start * Starting FOG Computer Imaging Solution: FOGImageReplicator [ OK ] # service FOGImageReplicator status * FOGImageReplicator is running
# service FOGMulticastManager status * FOGMulticastManager is not running # service FOGMulticastManager start * Starting FOG Computer Imaging Solution: FOGMulticastManager [ OK ] # service FOGMulticastManager status * FOGMulticastManager is running
# service FOGPingHosts status * FOGPingHosts is not running # service FOGPingHosts start * Starting FOG Computer Imaging Solution: FOGPingHosts [ OK ] # service FOGPingHosts status * FOGPingHosts is running
# service FOGScheduler status * FOGScheduler is not running # service FOGScheduler start * Starting FOG Computer Imaging Solution: FOGScheduler [ OK ] # service FOGScheduler status * FOGScheduler is running
# service FOGSnapinReplicator status * FOGSnapinReplicator is not running # service FOGSnapinReplicator start * Starting FOG Computer Imaging Solution: FOGSnapinReplicator [ OK ] # service FOGSnapinReplicator status * FOGSnapinReplicator is running
But after a reboot, they are not running any more:
# service FOGImageReplicator status * FOGImageReplicator is not running # service FOGMulticastManager status * FOGMulticastManager is not running # service FOGPingHosts status * FOGPingHosts is not running # service FOGScheduler status * FOGScheduler is not running # service FOGSnapinReplicator status * FOGSnapinReplicator is not running
All of the logs in /opt/fog/log contain the same thing:
[07-12-16 9:42:11 am] ___ ___ ___ /\ \ /\ \ /\ \ /::\ \ /::\ \ /::\ \ /:/\:\ \ /:/\:\ \ /:/\:\ \ /::\-\:\ \ /:/ \:\ \ /:/ \:\ \ /:/\:\ \:\__\ /:/__/ \:\__\ /:/__/_\:\__\ \/__\:\ \/__/ \:\ \ /:/ / \:\ /\ \/__/ \:\__\ \:\ /:/ / \:\ \:\__\ \/__/ \:\/:/ / \:\/:/ / \::/ / \::/ / \/__/ \/__/ ########################################### # Free Computer Imaging Solution # # Credits: # # http://fogproject.org/credits # # GNU GPL Version 3 # ###########################################
Except the service master:
[07-12-16 9:39:16 am] FOGImageReplicator Start [07-12-16 9:39:16 am] FOGImageReplicator forked child process (23817). [07-12-16 9:39:16 am] FOGImageReplicator child process (23817) is running. [07-12-16 9:39:48 am] service_signal_handler (23816) received signal 2. [07-12-16 9:39:48 am] service_signal_handler (23816) killing child (23817). [07-12-16 9:39:48 am] service_signal_handler (23816) exiting. [07-12-16 9:42:11 am] FOGImageReplicator Start [07-12-16 9:42:11 am] FOGImageReplicator forked child process (24066). [07-12-16 9:42:11 am] FOGImageReplicator child process (24066) is running. [07-12-16 9:42:30 am] FOGMulticastManager Start [07-12-16 9:42:30 am] FOGMulticastManager forked child process (24139). [07-12-16 9:42:30 am] FOGMulticastManager child process (24139) is running. [07-12-16 9:42:42 am] FOGPingHosts Start [07-12-16 9:42:42 am] FOGPingHosts forked child process (24184). [07-12-16 9:42:42 am] FOGPingHosts child process (24184) is running. [07-12-16 9:42:54 am] FOGTaskScheduler Start [07-12-16 9:42:54 am] FOGTaskScheduler forked child process (24241). [07-12-16 9:42:54 am] FOGTaskScheduler child process (24241) is running. [07-12-16 9:43:03 am] FOGImageReplicator Start [07-12-16 9:43:03 am] FOGImageReplicator forked child process (24300). [07-12-16 9:43:03 am] FOGImageReplicator child process (24300) is running. [07-12-16 9:46:11 am] service_signal_handler (24064) received signal 15. [07-12-16 9:46:11 am] service_signal_handler (24064) killing child (24066). [07-12-16 9:46:11 am] service_signal_handler (24064) exiting. [07-12-16 9:46:11 am] service_signal_handler (24136) received signal 15. [07-12-16 9:46:11 am] service_signal_handler (24136) killing child (24139). [07-12-16 9:46:11 am] service_signal_handler (24136) exiting. [07-12-16 9:46:11 am] service_signal_handler (24181) received signal 15. [07-12-16 9:46:11 am] service_signal_handler (24181) killing child (24184). [07-12-16 9:46:11 am] service_signal_handler (24181) exiting. [07-12-16 9:46:11 am] service_signal_handler (24238) received signal 15. [07-12-16 9:46:11 am] service_signal_handler (24238) killing child (24241). [07-12-16 9:46:11 am] service_signal_handler (24238) exiting. [07-12-16 9:46:11 am] service_signal_handler (24298) received signal 15. [07-12-16 9:46:11 am] service_signal_handler (24298) killing child (24300). [07-12-16 9:46:11 am] service_signal_handler (24298) exiting.
They fail to start using
service FOGxxx start
, since the pids still exist in /var/run/fog. Deleting those and starting manually as in the beginning of this post works. -
@dolf said in Services are not running. Where are the logs?:
Call to undefined function curl_init() in
If you run:
sudo apt-get install php5-curl
Then:sudo service FOGMulticastManager stop sudo service FOGImageReplicator stop sudo service FOGSnapinReplicator stop sudo service FOGPingHosts stop sudo service FOGScheduler stop sleep 10 sudo service FOGMulticastManager start sudo service FOGImageReplicator start sudo service FOGSnapinReplicator start sudo service FOGPingHosts start sudo service FOGScheduler start
I think you’re close now.
-
My bad. I didn’t enable the apache php5.6 module after uninstalling php5.
# a2enmod php5.6 # service apache2 restart
Still didn’t work. It seems like I broke my php and/or webserver. After reading this, I noticed that the php mime config was missing. So I did the brave thing and purges all versions of php and apache from my server. Starting over…
-
AHA! After purging all forms of PHP and Apache from my server, I re-ran the fog installer. (Discovered some apt issues with old and obsolete packages. Killed those by uninstalling everything that I don’t need. Ran the fog installer again. Then it worked.) Still got errors about
mysqliroot
andcurl_init()
being missing, but then I had this idea:Apache2 is using the php5 module, so it always invokes php5. php5-curl and php5-mysql were installed. But the fog installer also caused php7.0 to be installed. php7.0-curl and php7.0-mysql were not installed. So I checked which version was being used on the command line:
# update-alternatives --config php There are 2 choices for the alternative php (providing /usr/bin/php). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/php7.0 70 auto mode 1 /usr/bin/php5 50 manual mode 2 /usr/bin/php7.0 70 manual mode Press enter to keep the current choice[*], or type selection number: 1 update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in manual mode
Sure enough, it started working after changing from php7.0 to php5. All services are running, even after a reboot.
I am a happy bloke.
-
@dolf Great to see you got this sorted! Seems like the system was a bit messed up.
-
@dolf I guess another route would be to install those php 7 things.
Sounds to me like you didn’t install FOG on Ubuntu 14 with the recommended command for php7. Let me find that…
here’s the command to have FOG use all PHP 7:
php_ver='7.0' php_verAdds='-7.0' ./installfog.sh
If running Ubuntu 16, you’ll need to use that command to start the installer, and THEN when it asks for the DB to be updated - You’d go into MySQL and make a tweak to the root user:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
And then continue to the web interface to update fog.This is referencing a post I made here:
https://forums.fogproject.org/topic/7131/fog-on-ubuntu-16-04-php7/27 -
I’m on Ubuntu 14.04 though…
Anyway, it’s working with php5.