Ctlscript status shows as daemon not running

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Permissions
bnsupport ID: 56216e3c-5162-3108-433a-3704fcd7e511
Description:
Hi,
All my websites have gone down. This issue happened yesterday as well.
I need to restart my server everytime this happens. What is the solution?

Below is the screenshot of the error:

Hi @huzanforbes,

The team will continue evaluating this but could you please run the following commands when this happens again in your machine?

sudo service bitnami status
ps aux | grep gonit
sudo cat /var/run/gonit.pid
sudo gonit status
sudo head -n10 /var/log/gonit.log

Thanks

@jota
Screenshot below

@jota

Hi @jota

This is a very serious problem as my instance needs to be restarted very often then the issue comes up. Kindly support.

Hi @huzanforbes,

Can you try to restart gonit?

sudo gonit

If you get the following error

Socket file '/var/run/gonit.sock' is not writable

Remove that file:

sudo rm /var/run/gonit.sock

And try again:

sudo gonit

And check the status:

sudo /opt/bitnami/ctlscript.sh status

Regards,
Michiel

Hi @michiel

Please find below screenshot:

Not sure why my apache/mysql/php-fpm are not running. Is this normal?

Huzan

Hi @huzanforbes,

It seems that gonit was stopped due to performance issues of the instance.

Can you try to restart the services?

sudo /opt/bitnami/ctlscript.sh restart

To get more information about why gonit stopped can you tell me the output of this command?

sudo cat /var/log/syslog | grep gonit

Regards,
Michiel

I don’t get any log
image

Hi @huzanforbes,

There was a typo in one of my previous messages

Can you run this command instead?

sudo tail -n30 /var/log/gonit.log

If gonit is terminated somehow, you should find this information

time="2020-09-28T14:45:58Z" level=info msg="Terminating application..."
time="2020-09-28T14:45:58Z" level=info msg=Terminated.
time="2020-09-28T14:46:09Z" level=info msg="Performing checks"

This command should print the lines with “terminated”, “fail” or “error”

sudo cat /var/log/gonit.log | grep -i "terminated\|fail\|error"

Hi @jota

Screenshot:

Screenshot:

Kindly support.

Hi @huzanforbes,

As you can see in the second screenshot, gonit was terminated on Sept 21st, 23rd and 24th. That’s probably due to the really poor performance instance you are using. I suggest you increase the instance type to not to run into these performance issues anymore.

If you want to continue using the same instance, you will need to start the gonit process every time it’s terminated. The rest of services shouldn’t be affected by this.

1 Like

Hi @jota

Again my Apache, MySQL and PHP stopped on its own. It’s very embarrassing as the site keeps going down on its own. Is there a way to start it automatically when it goes down? Why does it stop on its own? The instance has barely any traffic.

Hi @huzanforbes,

gonit takes care of starting the services when they go down, the problem is that gonit is probably down at that time too. In my previous message, I suggested you to increase the instance type because the one you have has a really poor performance, did you do so?

Hi @jota
I haven’t changed my instance yet. However from the metrics on AWS, my metrics aren’t that high. Why is this problem coming then?

Despite not having high volume and enough space does upgrade confirm to solve the issue?image
image
Instance Space:
image

Hi @huzanforbes,

We are not talking about CPU usage but RAM usage. You are probably running out of RAM memory at some point and that causes the services to fail.

Hi @jota

I never faced this issue in the previous instance where the PHP version was lower. I’ll monitor this on a higher instance and let you know. Is there a way to get a log of the RAM usage?

Hi @jota

Can I setup a CRON job to ensure the ctlscript.sh status is always active?

I would set a CRON to restart ctlscript.sh every hour so even if it goes down it restarts every hour and not closed for hours at a stretch.

Kindly support.

Yes, of course. However, I suggest you create a simple script that restarts Gonit in case it fails because if you don’t do that, you will get errors when trying to start the Bitnami services.

You will need to implement the logic we talked about here